Condividi tramite


Interfaccia ISyncMgrHandlerCollection (syncmgr.h)

Espone i metodi che forniscono un enumeratore di ID del gestore di sincronizzazione e crea un'istanza di tali gestori di sincronizzazione.

Ereditarietà

L'interfaccia ISyncMgrHandlerCollection eredita dall'interfaccia IUnknown . ISyncMgrHandlerCollection include anche questi tipi di membri:

Metodi

L'interfaccia ISyncMgrHandlerCollection include questi metodi.

 
ISyncMgrHandlerCollection::BindToHandler

Crea un'istanza di un gestore di sincronizzazione specificato quando viene chiamato dal Centro sincronizzazione.
ISyncMgrHandlerCollection::GetHandlerEnumerator

Ottiene un enumeratore che fornisce l'accesso agli ID dei gestori di sincronizzazione esposti a e gestiti dall'utente.

Commenti

L'autore di un gestore di sincronizzazione implementa questa interfaccia per supportare più dispositivi o computer e sincronizzare i dettagli in modo indipendente. Sync Center usa la raccolta del gestore per richiedere l'istanza dei singoli gestori di sincronizzazione. ISyncMgrHandlerCollection consente anche a un autore del gestore di sincronizzazione di aggiungere i gestori in modo dinamico al Centro sincronizzazione anziché registrarne uno singolarmente nel Registro di sistema.

Nell'esempio seguente viene illustrata un'implementazione struttura di questa interfaccia.

class CMyHandlerCollection : public ISyncMgrHandlerCollection
{
public:
    // IUnknown
    // ISyncMgrHandlerCollection
    IFACEMETHODIMP GetHandlerEnumerator(__out IEnumString **ppenum);
    IFACEMETHODIMP BindToHandler(
        __in LPCWSTR    pszHandlerID,
        __in REFIID     riid,
        __out void    **ppv);
};

STDMETHODIMP CMyHandlerCollection::GetHandlerEnumerator(
    __out IEnumString **ppenum)
{
    // IDs are retrieved from a data source such as the registry.
    // IDs could be retrieved either by this collection class 
    // or the factory method.
    return CEnumMyHandlerIDs_Create(ppenum);
}

STDMETHODIMP CMyHandlerCollection::BindToHandler(
    __in LPCWSTR    pszHandlerID,
    __in REFIID     riid,
    __out void    **ppv)
{
    // Map the pszHandlerID to the handler to create. This could be done
    // by the factory method or by some other method.
    return CMyHandler_Create(pszHandlerID, riid, ppv);
}

Requisiti

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