The following procedure is required to issue a blocking APPC verb. In the sample code, the verb issued is MC_SEND_DATA.
#include <winappc.h>
.
.
struct mc_send_data mcsend;
The VCB structures are declared in WINAPPC.H; one of these structures is:
mc_send_data
memset( mcsend, '\0', sizeof( mcsend ) );
mcsend.opcode = AP_M_SEND_DATA;
mcsend.opext = AP_MAPPED_CONVERSATION;
memcpy( mcsend.tp_id, tp_id, sizeof( tp_id ) );
mcsend.conv_id = conv_id;
mcsend.dlen = datalen;
mcsend.dptr = sharebufptr;
The values AP_MAPPED_CONVERSATION and AP_M_SEND_DATA are symbolic constants representing integers. These constants are defined in WINAPPC.H.
APPC ( ( long ) (void FAR * ) &mcsend );
Use WinAsyncAPPC if you are running the application under Windows version 3.x.
To call WinAsyncAPPC:
HANDLE WINAPI WinAsyncAPPC (hWnd, 1pVCB)
When the asynchronous operation is complete, the application's window hWnd receives the message returned by RegisterWindowMessage with "WinAsyncAPPC" as the input string.
if( mcsend.primary_rc != AP_OK )
/* Do error routine */
.
.
.