HP-UX SNAplus2 R7 APPC Programmer's Guide
Writing Transaction Programs
APPC Entry Points: Windows Systems
Note
The APPC VCBs contain many parameters marked as “reserved”; some of these are
used internally by the SNAplus2 software, and others are not used in this version
but may be used in future versions. Your application must not attempt to access any
of these reserved parameters; instead, it must set the entire contents of the VCB to
zero to ensure that all of these parameters are zero, before it sets other parameters
that are used by the verb. This ensures that SNAplus2 will not misinterpret any of
its internally-used parameters, and also that your application will continue to work
with future SNAplus2 versions in which these parameters may be used to provide
new functions.
To set the VCB contents to zero, use
memset:
memset(vcb, 0, sizeof(vcb));
Returned Values
The return value from the function is one of the following:
Handle
The function call was successful (accepted). When the verb later completes, APPC uses this handle as an
identifier in the message passed to the application’s window procedure (for more information, see Section
2.4.2,
WinAsyncAPPC). The application also uses this handle as a parameter to the WinAPPCCancelAsyn-
cRequest call if it needs to cancel the outstanding verb.
0
(zero)
The function call was not successful (not accepted).
Usage
Before using WinAsyncAPPC for the first time, the application must use the RegisterWindowMessage
call to obtain the message identifier that APPC will use for messages indicating asynchronous verb completion.
RegisterWindowMessage is a standard Windows function call, not specific to APPC; refer to your Windows
documentation for more information about the function. (You do not need to issue the call again before subsequent
APPC verbs; the returned value will be the same for all calls issued by the application.)
The application must pass the string “WinAsyncAPPC” to the function; the returned value is a message identifier.
Each time an APPC verb that was issued using the WinAsyncAPPC entry point completes asynchronously, APPC
posts a message to the Windows handle specified on the WinAsyncAPPC 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 address of the VCB that was supplied to the original WinAsyncAPPC call;
the application can use this address to access the returned parameters in the VCB structure.
• The wParam argument contains the handle that was returned to the original WinAsyncAPPC call.
2.4.3 WinAsyncAPPCEx
The application uses this function to issue an APPC verb. If the verb completes asynchronously, APPC indicates
the completion by signaling an event handle. Use this function instead of the blocking versions of the verbs to
allow multiple sessions to be handled on the same thread.
Function Call
HANDLE WINAPI WinAsyncAPPCEx (
HANDLE eventhandle,
57