beautypg.com

HP NonStop G-Series User Manual

Page 114

background image

User Hook Library

Extending the Tandem DDE Gateway

8–12

110838 Tandem Computers Incorporated

TdmgwHookEnableUserHooks

The function is called when the Tandem DDE Gateway starts.

Return a bit-wise logical or (|) of the following constants defined in the TDMGW.H
file to enable the associated User Hook Library functions:

TDMGW_HOOK_ENABLE_POKE_PRE_CON -

TdmgwHookDdePokePreConvert

TDMGW_HOOK_ENABLE_REQ_POST_CON -

TdmgwHookDdeRequestPostConvert

TDMGW_HOOK_ENABLE_GET_DDE_SIZE -

TdmgwHookGetRequestDdeSize

TDMGW_HOOK_ENABLE_IS_CONV_SUP -

TdmgwHookIsConvSupported

TDMGW_HOOK_ENABLE_POST_REP_MSG -

TdmgwHookPostReplyMessage

TDMGW_HOOK_ENABLE_PRE_SEND_MSG -

TdmgwHookPreSendMessage

TDMGW_HOOK_ENABLE_UMS_POST_REC -

TdmgwHookUmsPostReceiveMessage

Prototype

unsigned long FAR PASCAL TdmgwHookEnableUserHooks ();

Parameters

Return Value

Bits indicating which User Hook Library functions
are enabled and should be called by the Tandem
DDE Gateway.

TdmgwHookGetRequestDdeSize

This function may be called when your client application does an element-by-element
DDE Request function.

You can enable the function in either of the following ways:

1.

By returning a value from TdmgwHookEnableUserHooks with the
TDMGW_HOOK_ENABLE_GET_DDE_SIZE bit set. The function will be called
for every time your client application does a DDE Request function.

2.

By returning non-zero in both the pbSupportedFormat and
pbConvertWithOnlyHookCode parameters from the
TdmgwHookIsConvSupported function. In this case,
TdmgwHookGetRequestDdeSize will be called only for the current DDE Request
operation.

In the first case, the parameter puRequestElementDdeSize contains the default size of
the memory area to be allocated for the converted data. You can change the value to
allocate (usually extra) memory.

In the second case, you must provide the size of the memory area to be allocated for
the converted data.

Details of the data element (such as element name, size, data type) are in the
tagDdeDictElementData structure pointed to by pstructElementData.