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.
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.