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 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.
If the msgtype parameter is invalid, the message generation process does not validate it. The generateMsg() method displays an alert that the message is not in the message file.
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; }