2.1 DCOD Calling Structure
To solve this problem, a pair of message utilities are available to PSYXs:
void SaveMessageAndMakeCode(GetMsgCodeStruct *msgData, long id); int LoadMessageString(long msg, long id, char *buffer);These functions are generally used in the following way:
pGetMsgCodemessage is received, SaveMessageAndMakeCode() is called, passing in the DCOD's ID as the second parameter. This function reads and appropriately modifies the
GetMsgCodeStructstructure, inventing a new four-character message ID for the string (or using a message ID generated previously, if the string has been passed to this DCOD before).
When the DCOD later receives a message ID that it does not recognize, it calls LoadMessageString(). If the message ID is one that was invented by SaveMessageAndMakeCode(), LoadMessageString() puts the original message string (up to 256 bytes) into the
bufferparameter and returns
TRUE. If LoadMessageString() returns
FALSE, the DCOD should not attempt to respond to the message.
Generated with CERN WebMaker