The WinCPICExtractEvent function provides a method for an application to determine the event handle being used for a CPI-C conversation.
VOID WINAPI WinCPICExtractEvent(
unsigned char FAR *conversation_ID, | |
HANDLE FAR *event_handle, | |
CM_INT32 FAR *return_code | |
); |
When a verb is issued on a nonblocking conversation, it returns CM_OPERATION_INCOMPLETE if it is going to complete asynchronously. If an event has been registered with the conversation, then the application can call WaitForSingleObject or WaitForMultipleObjects to be notified of the completion of the verb. WinCPICExtractEvent allows a CPI-C application to determine this event handle. When the verb has completed, the application must call Wait_for_Conversation to determine the return code for the asynchronous verb. The Cancel_Conversation function can be called to cancel an operation and conversation.
If no event has been registered, then the asynchronous verb completes as it does at present, which is by posting a message to the window that the application has registered with the CPI-C library.