Generates a message from a set of predefined messages in a message file.
Syntax
char * generateMsg(int msgNum, int msgType, char * info, int argCount, ...);
Parameters
XRD_WARNING XRD_ERROR XRD_FATAL XRD_INFO XRD_TRACE
Return values
A character pointer to the generated message.
Notes
The generateMsg() method allocates memory to store a generated message. When the connector has logged the message, it should call the freeMemory() method to release the allocated memory. This method is a member of the connector framework class JToCPPVeneer. The syntax of the call is:
void freeMemory(char * mem)
where mem is the memory allocated by generateMsg(). See the sample code below for an example of how to call this method.
Examples
char * msg; ret_code = connect_to_app(userName, password); // Message 1100 - Failed to connect to application if (ret_code == -1) { msg = generateMsg(1100, CxMsgFormat::XRD_ERROR, NULL, 0, NULL); logMsg(msg); JToCPPVeneer::getTheHandlerStuff()->freeMemory(msg); return BON_FAIL; }