ISyncMgrHandlerInfo::GetTypeLabel method (syncmgr.h)
Gets a label for the handler type. This typically provides the model of the device or an equivalent handler-specific identity string.
HRESULT GetTypeLabel(
[out] LPWSTR *ppszTypeLabel
);
[out] ppszTypeLabel
Type: LPWSTR*
When this method returns, contains a pointer to a buffer containing the label string.
Type: HRESULT
Returns S_OK if successful, or an error value otherwise. If the method fails, ppszTypeLabel contains an empty string.
The label value is displayed as the System.Sync.HandlerTypeLabel (PKEY_Sync_HandlerTypeLabel) property in the folder UI. Sync Center calls this method whenever the UpdateHandler method is called.
The handler is responsible for allocating the string buffer pointed to by ppszTypeLabel through CoTaskMemAlloc. Sync Center deallocates the string buffer through CoTaskMemFree.
The following example shows an implementation of this method.
STDMETHODIMP CMyDeviceHandler::GetTypeLabel(__out LPWSTR *ppszTypeLabel)
{
LPWSTR pszTypeLabel = NULL;
HRESULT hr = LoadStringAlloc(g_hmodThisDll,
IDS_HANDLER_TYPE_LABEL,
&pszTypeLabel);
if (SUCCEEDED(hr))
{
// Duplicate for the caller.
hr = SHCoAllocString(pszTypeLabel, ppszTypeLabel);
LocalFree(pszTypeLabel);
}
return hr;
}
Requirement | Value |
---|---|
Minimum supported client | Windows Vista [desktop apps only] |
Minimum supported server | Windows Server 2008 [desktop apps only] |
Target Platform | Windows |
Header | syncmgr.h |