WebSphere MQ for Windows server, WebSphere MQ client for Windows

The exit is a DLL that must be written in C.

Define a dummy MQStart() routine in the exit and specify MQStart as the entry point in the library. Figure 84 shows how to set up an entry to your program:

Figure 84. Sample source code for a channel exit on Windows
#include <cmqc.h>
#include <cmqxc.h>
 
void MQStart() {;} /* dummy entry point - for consistency only */
void MQENTRY ChannelExit ( PMQCXP  pChannelExitParms,
                           PMQCD   pChannelDefinition,
                           PMQLONG pDataLength,
                           PMQLONG pAgentBufferLength,
                           PMQVOID pAgentBuffer,
                           PMQLONG pExitBufferLength,
                           PMQPTR  pExitBufferAddr)
{
... Insert code here
}

In order to access the fields pointed to by pChannelExitParms and pChannelDefinition you need to insert the following lines in your exit program:


·
·
·
/* Variable definitions */
·
·
·
PMQCXP pParms; PMQCD pChDef;
·
·
·
/* Code */
·
·
·
pParms = (PMQCXP)pChannelExitParms; pChDef = (PMQCD)pChannelDefinition;

The pointers pParms and pChDef can then be dereferenced to access individual fields.

When writing channel exits for these products using Visual C++, you should do the following:

Figure 85. Sample DEF file for Windows
 LIBRARY exit
 
 PROTMODE
 
 DESCRIPTION 'Provides Retry and Channel exits'
 
 CODE SHARED    LOADONCALL
 DATA NONSHARED MULTIPLE
 
 HEAPSIZE   4096
 STACKSIZE  8192
 
 EXPORTS  Retry

1.
MQMVX.LIB is used for data conversion and is not available on client products.