Follow these steps:
A .DEF file called amqsvfcn.def is also supplied in the samples directory, <drive:\directory>\Program Files\IBM\WebSphere MQ\Tools\C\Samples. Take a copy of this file and rename it, for example, to MYFORMAT.DEF. Make sure that the name of the DLL being created and the name specified in MYFORMAT.DEF are the same. Overwrite the name FORMAT1 in MYFORMAT.DEF with the new format name.
Remember to use this name each time you send a message.
The functions generated by the CVTMQCVX command use macros which are written assuming that all structures are packed; they should be amended if this is not the case.
amqsvfc0.c is in <drive:\directory>\Tools\C\Samples where <drive:\directory> is the directory specified on installation. (The default installation directory is C:\Program Files\IBM\WebSphere MQ.)
The skeleton includes a sample header file amqsvmha.h in the same directory. Make sure that your include path points to this directory to pick up this file.
The amqsvmha.h file contains macros that are used by the code generated by the CRTMQCVX command. If the structure to be converted contains character data, then these macros call MQXCNVC.
/* Insert the functions produced by the data-conversion exit */
Here, insert the code fragment generated in step 3.
/* Insert calls to the code fragments to convert the format's */
This is followed by a commented-out call to the function ConverttagSTRUCT.
Change the name of the function to the name of the function you added in step 5a above. Remove the comment characters to activate the function. If there are several functions, create calls for each of them.
/* Insert the function prototypes for the functions produced by */
Here, insert the function prototype statements for the functions added in step 5a above.
cl -I <drive:\directory>\Program Files\IBM\WebSphere MQ\Tools\C\Include -Tp \ MYFORMAT.C -LD -DEFAULTLIB \ <drive:\directory>\Program Files\IBM\WebSphere MQ\Tools\Lib\mqm.lib \ <drive:\directory>\Program Files\IBM\WebSphere MQ\Tools\Lib\mqmvx.lib \ MYFORMAT.DEF
where <drive:\directory> is specified at installation,
Issue the command file to compile your exit as a DLL file.
C:\Program Files\IBM\WebSphere MQ\Exits
The path used to look for the data-conversion exits is given in the registry. The registry folder is:
HKEY_LOCAL_MACHINE\SOFTWARE\IBM\MQSeries\CurrentVersion\Configuration\ClientExitPath\
and the registry key is: ExitsDefaultPath. This path can be set for each queue manager and the exit is only looked for in that path or paths.
Defect 56844 |
---|
Notes: