The exit must be written in C, and is a DLL on Windows.
Define a dummy MQStart() routine in the exit and specify MQStart as the entry
point in the library. Figure 1 shows how to set up an entry to your
program:Figure 1. Sample source code for a channel exit
#include <cmqec.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
}
When writing channel exits for Windows using Visual
C++, we must write your own DEF file. An example of how is shown in Figure 2. For further information on writing channel exit programs, see Writing channel-exit programs.