Condividi tramite


Metodo ISyncMgrControl::UpdateEvents (syncmgr.h)

Informa Sync Center che gli eventi sono stati aggiunti per un gestore o un elemento specifici.

Sintassi

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

Parametri

[in] pszHandlerID

Tipo: LPCWSTR

Puntatore a un buffer contenente l'ID univoco del gestore che gestisce l'elemento. Questa stringa è di lunghezza massima MAX_SYNCMGR_ID incluso il carattere null terminante.

[in] pszItemID

Tipo: LPCWSTR

Puntatore a un buffer contenente l'ID univoco dell'elemento. Questa stringa è di lunghezza massima MAX_SYNCMGR_ID incluso il carattere null terminante. Questo parametro può essere NULL se l'evento si è verificato nel gestore anziché in un elemento specifico.

[in] nControlFlags

Tipo: SYNCMGR_CONTROL_FLAGS

Valore dell'enumerazione SYNCMGR_CONTROL_FLAGS che specifica se l'aggiornamento deve essere eseguito in modo sincrono o asincrono.

Valore restituito

Tipo: HRESULT

Se questo metodo ha esito positivo, restituisce S_OK. In caso contrario, restituisce un codice di errore HRESULT .

Commenti

Se SYNCMGR_CF_WAIT è impostato nel parametro nControlFlags , UpdateEvents non restituisce fino a quando Sync Center non ha caricato il gestore specificato, recuperato l'archivio eventi del gestore e ricaricato tutti gli eventi da tale archivio. Se il gestore viene fornito da una raccolta di gestori, la raccolta del gestore viene caricata anche per ricaricare il gestore.

Esempio

Nell'esempio seguente viene illustrato l'utilizzo di ISyncMgrControl::UpdateEvents tramite la procedura di un gestore.

void CMyDeviceHandler::Synchronize(...)
{
    ...
    // Add events to the event store.

    // 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 we added events to our event store.
        // By passing NULL in pszItemID, we tell Sync Center that the event
        // occurred on the handler rather than a specific item.
        hr = pControl->UpdateEvents(s_szMyDeviceSyncHandlerID, 
                                    NULL,
                                    SYNCMGR_CF_NOWAIT);
        pControl->Release();
    }

    ...

}

Requisiti

   
Client minimo supportato Windows Vista [solo app desktop]
Server minimo supportato Windows Server 2008 [solo app desktop]
Piattaforma di destinazione Windows
Intestazione syncmgr.h