CLlmClient::GetModelName Method  
 
INT GetModelName(
  LPTSTR lpszModelName,  
  INT nMaxLength  
);
INT GetModelName(
  CString &strModelName  
);

The GetModelName method returns the name of the current model for the client session.

Parameters

lpszModelName
A pointer to a string buffer which will contain the name of the current model when the method returns. This parameter cannot be NULL and must be large enough to contain the complete model name, including the terminating null character. If the buffer is not large enough to contain the entire name, the method will fail. An alternate version of this method accepts a reference to a CString object which will contain the model name when the method returns.
nMaxLength
An integer value which specifies the maximum number of characters which can be copied into the string buffer, including the terminating null character. This parameter cannot be zero and the method will fail if an invalid size is provided by the caller.

Return Value

If the method succeeds, the return value is the number of characters copied into the string buffer, not including the terminating null character. If the method fails, the return value is zero. To get extended error information, call GetLastError.

Remarks

The GetModelName method returns the model name currently associated with the client session. This is the model that will be used for subsequent requests unless it is changed by calling SetModelName. The model name is stored as part of the session state and does not require the client session to be disconnected and reconnected.

The returned model name may have been specified when the session was created, selected automatically from the provider defaults, or changed by a previous call to SetModelName. If no valid model name is currently associated with the session, the method will fail.

Changing the model name only affects subsequent requests. It does not modify any messages or responses already stored in the client history, and it does not validate that the model exists or is available from the current provider. To enumerate or validate model names, use methods such as EnumModels, GetModelInfo, or ValidateModel.

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