beautypg.com

HP NonStop G-Series User Manual

Page 107

background image

User Hook Library

Extending the Tandem DDE Gateway

110838 Tandem Computers Incorporated

8–5

There is always a User Hook Library. The default User Hook Library provided with
the Tandem DDE Gateway performs no processing other than to return a flag when
you start the Tandem DDE Gateway to indicate that no other User Hook Library
functions are to be called.

Follow these steps to develop a User Hook Library:

1.

Copy the files USERHOOK.* from the EXTEND\ subdirectory.

2.

Review the User Hook Library example in the EXAMPLES\USERHOOK
subdirectory.

3.

Develop User Hook Library functions as required by your application.

4.

Compile your new User Hook Library to create a new USERHOOK.DLL file.

5.

Stop the Tandem DDE Gateway.

6.

Backup the old USERHOOK.DLL file from the GW\ subdirectory and replace it
with your new USERHOOK.DLL.

7.

Restart the Tandem DDE Gateway.

When User Hook Library

Functions Are Called

You can cause the Tandem DDE Gateway to call your User Hook Library functions in
two ways:

Enable the User Hook Library function by setting the appropriate bit in the value
that you return from the TdmgwHookEnableUserHooks function. User Hook
Library functions will then be called for each DDE Poke and DDE Request
function.

Return a flag from the TdmgwHookIsConvSupported routine indicating that you
will do the data conversion with only your User Hook Library code for the current
data element. The User Hook Library functions will be called only for the current
data element.

User Hook Library functions related to DDE Poke and DDE Request functions are
called only when you use the Tandem DDE Gateway element-by-element approach.

The TdmgwHookEnableUserHooks function is called when you start the Tandem
DDE Gateway. In the return value, you set individual bits to indicate which User
Hook Library functions are to be called by the Tandem DDE Gateway.

Each time you do a DDE Poke or DDE Request function in your client application, the
TdmgwHookIsConvSupported function is called. On entry, the pbSupportedFormat
parameter indicates whether the Tandem DDE Gateway has a built-in automatic data
conversion from the specified clipboard format to the required Tandem data
representation. This function may be called many times if the client application is
hunting for a supported clipboard format.

You can either supplement a built-in automatic data conversion or implement a new
data conversion.

If you want to supplement a built-in automatic data conversion, reject clipboard
formats until the client application hunts to one that your User Hook Library code