Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Export (0) Print
Expand All

ISyncMgrControl::StartHandlerSync method

Initiates the synchronization of all items managed by a particular handler.

Syntax


HRESULT StartHandlerSync(
  [in] LPCWSTR                    pszHandlerID,
  [in] HWND                       hwndOwner,
  [in] IUnknown                   *punk,
  [in] SYNCMGR_SYNC_CONTROL_FLAGS nSyncControlFlags,
  [in] ISyncMgrSyncResult         *pResult
);

Parameters

pszHandlerID [in]

Type: LPCWSTR

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

hwndOwner [in]

Type: HWND

A handle to the window that the handler can use to display any necessary UI. This value can be NULL.

punk [in]

Type: IUnknown*

A pointer to an IUnknown to be passed to Synchronize. This parameter can be NULL.

nSyncControlFlags [in]

Type: SYNCMGR_SYNC_CONTROL_FLAGS

A member of the SYNCMGR_SYNC_CONTROL_FLAGS enumeration that specifies whether an item found in both a current sync and a queued sync should be synchronized again when the queued sync is performed.

pResult [in]

Type: ISyncMgrSyncResult*

A pointer to an instance of ISyncMgrSyncResult, whose Result method is called when the synchronization ends, either through success, failure, or cancellation. The Result method is called with the aggregated state of the handler synchronization. This parameter can be NULL.

Return value

Type: HRESULT

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

Examples

The following example shows the usage of ISyncMgrControl::StartHandlerSync by a handler's procedure.


void CMyDeviceHandler::MiscProc(...)
{
    ...

    // Get the Sync Center control object.
    ISyncMgrControl *pControl = NULL;
    
    hr = CoCreateInstance(CLSID_SyncMgrControl, 
                          CLSCTX_SERVER,
                          IID_PPV_ARGS(&pControl));
    if (SUCCEEDED(hr))
    {
        // Synchronize all sync items for the sync handler.
        hr = pControl->StartHandlerSync(s_szMySyncHandlerID,
                                        hwndOwner, 
                                        NULL, 
                                        NULL);
        pControl->Release();
    }

    ...

}


Requirements

Minimum supported client

Windows Vista [desktop apps only]

Minimum supported server

Windows Server 2008 [desktop apps only]

Header

Syncmgr.h

IDL

Syncmgr.idl

 

 

Community Additions

ADD
Show:
© 2015 Microsoft