| INT GetProviderUrl( |
| |
LPCTSTR lpszBaseUrl, |
|
| |
INT nMaxLength |
|
| ); |
| INT GetProviderUrl( |
| |
CString &strBaseUrl |
|
| ); |
The GetProviderUrl method returns the current endpoint URL
used for client requests.
Parameters
- lpszBaseUrl
- A pointer to a buffer that receives the base URL used by the client
session when making requests to the provider. This parameter may be NULL if
the base URL is not required. An alternate version of this method
accepts a CString object which will contain the URL when the
method returns.
- nMaxLength
- The size of the buffer specified by the lpszBaseUrl parameter, in
characters. If lpszBaseUrl is NULL, this value should be zero. If a buffer
is provided, it must be large enough to store the base URL, including the
terminating null character.
Return Value
If the method succeeds, the return value is the length of the base
URL, not including the terminating null character. If the method fails,
the return value is zero. To get extended error information, call
GetLastError.
Remarks
The GetProviderUrl method can be used to determine the base
URL path used by the provider associated with the current client session.
The base URL is returned as a null-terminated string. If the buffer is not
large enough to receive the entire string, the method fails and sets the
error code to ST_ERROR_BUFFER_TOO_SMALL. We recommend a buffer size of at
least 256 characters when retrieving the base URL.
To determine the default endpoint URL used by a specific service provider,
use the GetDefaultUrl method.
Example
DWORD dwProviderId = llmClient.GetProviderId();
if (dwProviderId != LLM_PROVIDER_UNKNOWN)
{
TCHAR szBaseUrl[256] = {0};
llmClient.GetProviderUrl(szBaseUrl, _countof(szBaseUrl));
_tprintf(_T("Provider ID: %lu\n"), dwProviderId);
_tprintf(_T("Base URL: %s\n"), szBaseUrl);
}
else
{
DWORD dwError = llmClient.GetLastError();
_tprintf(_T("Unable to get provider information, error 0x%08lx\n"), dwError);
}
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
|