ISyncMgrSyncItemContainer::GetSyncItem method

Gets a specified sync item.

Syntax


HRESULT GetSyncItem(
  [in]  LPCWSTR          *ppszItemID,
  [out] ISyncMgrSyncItem **ppItem
);

Parameters

ppszItemID [in]

Type: LPCWSTR*

A pointer to a buffer containing the item ID representing the desired item. The ID is of maximum length MAX_SYNCMGR_ID including the terminating null character.

ppItem [out]

Type: ISyncMgrSyncItem**

When this method returns, contains the address of a pointer to an ISyncMgrSyncItem instance representing the sync item.

Return value

Type: HRESULT

Returns S_OK if successful, or an error value otherwise. Returns E_INVALIDARG if the handler does not recognize the ID specified at ppszItemID.

Examples

The following example shows an implementation of this method.


STDMETHODIMP CMyDeviceHandler::GetSyncItem(__in LPCWSTR             pszItemID,
                                           __out ISyncMgrSyncItem **ppItem)
{
    HRESULT hr = E_INVALIDARG;
    *ppItem = NULL;
    
    for (DWORD iItem = 0; iItem < _cItems; iItem++)
    {
        if (lstrcmpiW(_pItems[iItem].GetIDPointer(), pszItemID) == 0)
        {
            hr = _pItems[iItem].QueryInterface(IID_PPV_ARGS(ppItem));
            break;
        }
    }

    return hr;
}


Requirements

Minimum supported client

Windows Vista [desktop apps only]

Minimum supported server

Windows Server 2008 [desktop apps only]

Header

Syncmgr.h

IDL

Syncmgr.idl

 

 

Show: