CLlmClient::GetMessageById Method  
 
BOOL LlmGetMessageById(
  DWORD dwMessageId,  
  LPLLM_MESSAGE lpMessage,  
  LPLLM_RESPONSE lpResponse  
);

The GetMessageById method retrieves a message turn in the client history based on a numeric identifier.

Parameters

dwMessageId
A numeric value which identifies a specific message and response.
lpMessage
A pointer to an LLM_MESSAGE structure that receives information about the client request. This parameter may be NULL, in which case no message information is returned.
lpResponse
A pointer to an LLM_RESPONSE structure that receives information about the server response. This parameter may be NULL, in which case no response information is returned.

Return Value

If the method succeeds, the return value is non-zero. If the method fails, the return value is zero. To get extended error information, call GetLastError.

Remarks

The GetMessageById method retrieves a specific message and its associated response from the client session history. This method can be used when an application has stored a message identifier or has obtained one using methods such as FindMessage. Message identifiers are returned when sending requests using SendMessage or SendMessageEx.

If message history has been disabled, the library does not retain previous messages. However, the most recent message and response are still available and may be retrieved specifying its message identifier. This also means the data returned in the LLM_MESSAGE and LLM_RESPONSE structures will only be valid until the next call to SendMessage, SendMessageEx, or until the session is reset or disconnected. Applications that need to preserve this information should make a copy of the data before issuing another request.

If the lpMessage and/or lpResponse parameters are specified, their respective structures must be initialized with the dwSize member set to the size of the structure before calling this method. This enables the library to validate the structure version and maintain compatibility with future releases.

Either the lpMessage or lpResponse parameter may be NULL if only one type of information is required. At least one of these parameters must be specified. If both parameters are NULL, the method fails and sets the error code to ST_ERROR_INVALID_PARAMETER.

Message identifiers are session-specific and are guaranteed to be unique only within the client session in which they were created. Applications must not rely on the internal assignment strategy used to generate these identifiers. The only guaranteed behavior is that message identifiers are assigned values which ensure newer messages always receive larger values than older messages.

If the specified message identifier does not match a message currently stored in the client history, the method fails. This can occur if the message has been removed because the history was cleared or trimmed.

Requirements

Minimum Desktop Platform: Windows 7 Service Pack 1
Minimum Server Platform: Windows Server 2008 R2 Service Pack 1
Header File: cstools12.h
Import Library: csllmv12.lib
Unicode: Implemented as Unicode and ANSI versions

See Also