Επεξεργασία

Κοινή χρήση μέσω


ISyncMgrHandler::GetObject method (syncmgr.h)

Creates a specific type of object related to the handler.

Syntax

HRESULT GetObject(
  [in]  REFGUID rguidObjectID,
  [in]  REFIID  riid,
  [out] void    **ppv
);

Parameters

[in] rguidObjectID

Type: REFGUID

A GUID identifying the type of object to create. One of the following values as defined in shlguid.h.

SYNCMGR_OBJECTID_BrowseContent

An object implementing the ISyncMgrUIOperation interface that shows the UI that enables the user to browse the contents of the item managed by the handler, such as a folder, device, computer on a network, or an application.

Sync Center only requests this object if the SYNCMGR_HCM_CAN_BROWSE_CONTENT capability flag is set in the mask retrieved by GetCapabilities.

SYNCMGR_OBJECTID_ConflictStore

An object implementing the ISyncMgrConflictStore interface that enables a handler to provide conflicts. These conflicts are shown in the Sync Center Conflicts folder. The conflict store should include conflicts for the handler as well as conflicts for all of its items. To include conflicts for only a specific item, Sync Center calls GetObject.

Sync Center only requests this object if the SYNCMGR_HCM_CONFLICT_STORE capability flag is set in the mask retrieved by GetCapabilities.

SYNCMGR_OBJECTID_EventLinkClick

An object implementing the ISyncMgrEventLinkUIOperation interface that implements the click action for a link provided on an event displayed in the Sync Results folder.

SYNCMGR_OBJECTID_EventStore

An object implementing the ISyncMgrEventStore interface that allows a handler to provide its own source of events. These events are shown in the Sync Results folder. The event store should include events for the handler as well as for all of its items. To include only events for a specific item, Sync Center calls GetObject. The event store is asked to delete the handler's events the next time the handler is synchronized. The default event store purges its events when the user logs off.

Sync Center only requests this object if the SYNCMGR_HCM_EVENT_STORE capability flag is set in the mask retrieved by GetCapabilities.

A handler is not required to provide an event store. The default event store provided by Sync Center can be used if it meets the handler's requirements.

SYNCMGR_OBJECTID_Icon

An icon extraction object that implements the IExtractIcon interface used to display an icon for the handler. This object should only be provided if the handler obtains its icon dynamically at run time. The preferred mechanism for providing the icon is to register the icon as the DefaultIcon in the registry.

Sync Center only requests this object if the SYNCMGR_HCM_PROVIDES_ICON capability flag is set in the mask retrieved by GetCapabilities.

SYNCMGR_OBJECTID_QueryBeforeActivate

An object implementing the ISyncMgrUIOperation interface that displays the UI that enables the user to configure a handler. This UI is shown when the user selects the handler in the Sync Setup folder, then selects the Setup task. Before requesting this object, Sync Center creates a separate thread for this operation and a new instance of the handler.

Sync Center only requests this object if the SYNCMGR_HCM_QUERY_BEFORE_ACTIVATE capability flag is set in the mask retrieved by GetCapabilities and the SYNCMGR_HPM_PREVENT_ACTIVATE policy flag is not set in the mask retrieved by GetPolicies.

SYNCMGR_OBJECTID_QueryBeforeDeactivate

An object implementing the ISyncMgrUIOperation interface that displays the UI when the user selects the handler in the Sync Center folder, then selects the Delete task. Before requesting this object, Sync Center creates a separate thread for this operation and a new instance of the handler.

Sync Center only requests this object if the SYNCMGR_HCM_QUERY_BEFORE_DEACTIVATE capability flag is set in the mask retrieved by GetCapabilities and the SYNCMGR_HPM_PREVENT_DEACTIVATE policy flag is not set in the mask retrieved by GetPolicies.

SYNCMGR_OBJECTID_QueryBeforeEnable

An object implementing the ISyncMgrUIOperation interface that displays the UI when the user selects the handler in the Sync Center folder and then selects the Enable task. Before requesting this object, Sync Center creates a separate thread for this operation and a new instance of the handler.

Sync Center only requests this object if the SYNCMGR_HCM_CAN_ENABLE and SYNCMGR_HCM_QUERY_BEFORE_ENABLE capability flags are set in the mask retrieved by GetCapabilities.

SYNCMGR_OBJECTID_QueryBeforeDisable

An object implementing the ISyncMgrUIOperation interface that displays the UI when the user selects the handler in the Sync Center folder and then selects the Disable task. Before requesting this object, Sync Center creates both a separate thread for this operation and a new instance of the handler.

Sync Center only requests this object if the SYNCMGR_HCM_CAN_DISABLE and SYNCMGR_HCM_QUERY_BEFORE_DISABLE capability flags are set in the mask retrieved by GetCapabilities.

SYNCMGR_OBJECTID_ShowSchedule

An object implementing the ISyncMgrUIOperation interface that displays the UI that enables the user to configure the schedule for the handler. Before requesting this object, Sync Center creates a separate thread for this operation and a new instance of the handler.

Sync Center only requests this object if the SYNCMGR_HCM_CAN_SHOW_SCHEDULE capability flag is set in the mask retrieved by GetCapabilities.

[in] riid

Type: REFIID

The IID of the requested interface. This depends on the object type named in rguidObjectID.

[out] ppv

Type: void**

When this method returns, contains the address of a pointer to the requested interface.

Return value

Type: HRESULT

Returns S_OK if successful, or an error value otherwise. Returns E_NOTIMPL if the handler does not support the requested type of object.

Remarks

The handler can implement the requested interface on itself or it can implement it on a different object.

Examples

The following example shows an implementation of this method.

STDMETHODIMP CMyDeviceHandler::GetObject( __in REFGUID   rguidObjectID, 
                                          __in REFIID    riid,
                                          __out void   **ppv)
{
    HRESULT hr = E_NOTIMPL;
    *ppv = NULL;

    if (rguidObjectID == SYNCMGR_OBJECTID_QueryBeforeActivate)
    {
        hr = _CreateSetupObject(riid, ppv);
    }
    else if (rguidObjectID == SYNCMGR_OBJECTID_EventStore)
    {
        hr = _CreateEventStore(NULL, riid, ppv);
    }

    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