HP-UX SNAplus2 CPI-C Programmer's Guide (June 2003)

CPI-C Calls
Specify_Windows_Handle (xchwnd)
Chapter 3 297
Specify_Windows_Handle (xchwnd)
For Windows The Specify_Windows_Handle call is issued by a CPI-C application to
specify a Windows handle to which CPI-C will send a message each time
a nonblocking CPI-C function completes. This provides an alternative
mechanism to using Wait_For_Conversation (as on HP-UX systems) to
wait for completion of the function. If you are writing a new CPI-C
application for Windows systems, you should use this mechanism and
not Wait_For_Conversation.
To use nonblocking calls and receive messages to indicate their
completion, the application must issue the following calls before issuing
a nonblocking call:
RegisterWindowMessage(), to obtain the message identifier that
CPI-C will use for messages indicating completion of a nonblocking
CPI-C function. This is a standard Windows function call, not specific
to CPI-C; refer to your Windows documentation for more information
about the function. The application must pass the value
WIN_CPIC_ASYNC_COMPLETE_MESSAGE to the function; the returned
value is a message identifier, as described below. (There is no need to
issue the call again before subsequent CPI-C calls; the returned
value will be the same for all calls issued by the application.)
Set_Processing_Mode, to set the conversation's processing mode to
CM_NON_BLOCKING.
Specify_Windows_Handle, to specify the handle to which the
completion message is sent.
Each time a nonblocking CPI-C function completes, CPI-C posts a
message to the window handle specified on the Specify_Windows_Handle
call. The format of the message is as follows:
The message identifier is the value returned from the
RegisterWindowMessage() call.
The
lParam
argument contains the conversation ID of the CPI-C call
that has completed.
The
wParam
argument contains the conversation
return_code
parameter from the CPI-C call that has completed. The possible
values for this parameter depend on the individual call.