cwbSV_CreateMessageTextHandle

Purpose

This function creates a message text object and returns a handle to it. This message handle can be used in your program to write message text to the currently active history log. The message text is supplied in a buffer passed on the cwbSV_LogMessageText() call.

Syntax

 
unsigned int CWB_ENTRY cwbSV_CreateMessageTextHandle(
                             char                    *productID,
                             char                    *componentID,
                             cwbSV_MessageTextHandle *messageTextHandle);

Parameters

char * productID - input
Points to a null-terminated string that contains a product identifier to be used on this message entry. Parameter is optional, if null, no productID is set. NOTE: A maximum of CWBSV_MAX_PRODUCT_ID characters will be logged for the product ID. Larger strings will be truncated.
char * componentID - input
Points to a null-terminated string that contains a component identifier to be used on this message entry. Parameter is optional, if null, no componentID is set. NOTE: A maximum of CWBSV_MAX_COMP_ID characters will be logged for the component ID. Larger strings will be truncated.
cwbSV_MessageTextHandle * messageTextHandle - input/output
Pointer to a cwbSV_MessageTextHandle where the handle will be returned. This handle should be used in subsequent calls to the message text functions.

Return Codes

The following list shows common return values.

CWB_OK
Successful completion.
CWB_INVALID_POINTER
NULL passed on output parameter.
CWB_NOT_ENOUGH_MEMORY
Insufficient memory to create handle.

Usage

It is recommended that you set a unique product ID and component ID in the message handle before using it to log message text. These ID's will distinguish your messages from other messages in the history log.