cniCreateMessage

Creates a new output message object. For every call to this function, there should be a matching call to cniDeleteMessage to return allocated resources when the processing on the output message has been completed.

Syntax

CciMessage* cniCreateMessage(
  int*                returnCode,
  CciMessageContext*  messageContext);

Parameters

returnCode
The return code from the function (output).
Possible return codes are:
  • CCI_SUCCESS
  • CCI_FAILURE
  • CCI_EXCEPTION
  • CCI_INV_MESSAGE_CONTEXT
messageContext
The address of the context for the message (input). Use cniGetMessageContext to get the context from an incoming message (for example, one received in the cniEvaluate function).

Return values

If successful, the address of the message object is returned. Otherwise, a value of zero (CCI_NULL_ADDR) is returned, and the returnCode parameter indicates the reason for the error.

Example

  outMsg = cniCreateMessage(&rc, cniGetMessageContext(&rc, message));