ISyncMgrControl::UpdateHandler method

Instructs Sync Center to reenumerate the items managed by a handler or informs it that properties of the handler have changed.

Syntax


HRESULT UpdateHandler(
  [in]  LPCWSTR pszHandlerID,
  [in]  SYNCMGR_CONTROL_FLAGS nControlFlags
);

Parameters

pszHandlerID [in]

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.

nControlFlags [in]

Type: SYNCMGR_CONTROL_FLAGS

A value from the SYNCMGR_CONTROL_FLAGS enumeration specifying whether the update should be performed synchronously or asynchronously.

Return value

Type: HRESULT

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

Remarks

If SYNCMGR_CF_WAIT is set in the nControlFlags parameter, UpdateHandler does not return until Sync Center has loaded the specified handler and reloaded all handler and item information. If the handler is provided by a handler collection, the handler collection is also loaded to reload the handler.

Examples

The following example shows the usage of ISyncMgrControl::UpdateHandler 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))
    {
        // Tell Sync Center that properties on the handler have changed.
        hr = pControl->UpdateHandler(s_szMySyncHandlerID, SYNCMGR_CF_WAIT);
        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