LlmGetMessageById Function  
 
BOOL WINAPI LlmGetMessageById(
  HCLIENT hClient,  
  DWORD dwMessageId,  
  LPLLM_MESSAGE lpMessage,  
  LPLLM_RESPONSE lpResponse  
);

The LlmGetMessageById function retrieves a message turn in the client history based on a numeric identifier.

Parameters

hClient
A handle to the client session.
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 function succeeds, the return value is non-zero. If the function fails, the return value is zero. To get extended error information, call LlmGetLastError.

Remarks

The LlmGetMessageById function retrieves a specific message and its associated response from the client session history. This function can be used when an application has stored a message identifier or has obtained one using functions such as LlmFindMessage. Message identifiers are returned when sending requests using LlmSendMessage or LlmSendMessageEx.

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 LlmSendMessage, LlmSendMessageEx, 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 function. 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 function 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 function 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

LlmFindMessage, LlmGetFirstMessage, LlmGetMessage, LlmGetNextMessage, LlmSendMessage, LlmSendMessageEx