ISyncMgrSessionCreator::CreateSession method (syncmgr.h)

Notifies Sync Center that synchronization of the specified items has begun.

Syntax

HRESULT CreateSession(
  [in] LPCWSTR              pszHandlerID,
  [in] LPCWSTR              *ppszItemIDs,
  [in] ULONG                cItems,
  [in] ISyncMgrSyncCallback **ppCallback
);

Parameters

[in] pszHandlerID

Type: LPCWSTR

A pointer to a buffer containing the unique ID of the handler. This string is of maximum length MAX_SYNCMGR_ID including the terminating null character.

[in] ppszItemIDs

Type: LPCWSTR*

The address of a pointer to a buffer containing an array of item IDs, managed by the handler specified in pszHandlerID, to be synchronized. Each ID is of maximum length MAX_SYNCMGR_ID including the terminating null character.

[in] cItems

Type: ULONG

The number of item IDs contained in the buffer referenced in ppszItemIDs.

[in] ppCallback

Type: ISyncMgrSyncCallback**

The address of a pointer to an instance of ISyncMgrSyncCallback used to report progress and events. This value can be NULL if no callback is needed.

Return value

Type: HRESULT

If this method succeeds, it returns S_OK. Otherwise, it returns an HRESULT error code.

Remarks

Both pszHandlerID and ppszItemIDs must be specified.

Examples

The following example shows the outline of an implementation of this method.

STDMETHODIMP CMyDeviceHandler::Synchronize(...)
{
    ...
    ISyncMgrSyncCallback *pCallback = NULL;

    hr = pCreator->CreateSession(_pszHandlerID, ppszItemIDs, cItems, &pCallback);
    if (SUCCEEDED(hr))
    {
        // Perform synchronization.
    }

    return hr;
}

Requirements

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