Skip to content

Latest commit

 

History

History
164 lines (113 loc) · 5.55 KB

nf-syncmgr-isyncmgrsynccallback-reportevent.md

File metadata and controls

164 lines (113 loc) · 5.55 KB
UID title description helpviewer_keywords old-location tech.root ms.assetid ms.date ms.keywords req.header req.include-header req.target-type req.target-min-winverclnt req.target-min-winversvr req.kmdf-ver req.umdf-ver req.ddi-compliance req.unicode-ansi req.idl req.max-support req.namespace req.assembly req.type-library req.lib req.dll req.irql targetos req.typenames req.redist ms.custom f1_keywords dev_langs topic_type api_type api_location api_name
NF:syncmgr.ISyncMgrSyncCallback.ReportEvent
ISyncMgrSyncCallback::ReportEvent (syncmgr.h)
Provides an event to add to the Sync Results folder for an item being synchronized.
ISyncMgrSyncCallback interface [Windows Shell]
ReportEvent method
ISyncMgrSyncCallback.ReportEvent
ISyncMgrSyncCallback::ReportEvent
ReportEvent
ReportEvent method [Windows Shell]
ReportEvent method [Windows Shell]
ISyncMgrSyncCallback interface
_shell_ISyncMgrSyncCallback_ReportEvent
shell.ISyncMgrSyncCallback_ReportEvent
syncmgr/ISyncMgrSyncCallback::ReportEvent
shell\ISyncMgrSyncCallback_ReportEvent.htm
shell
4c7d6627-1652-4920-9dce-a61673e6e656
12/05/2018
ISyncMgrSyncCallback interface [Windows Shell],ReportEvent method, ISyncMgrSyncCallback.ReportEvent, ISyncMgrSyncCallback::ReportEvent, ReportEvent, ReportEvent method [Windows Shell], ReportEvent method [Windows Shell],ISyncMgrSyncCallback interface, _shell_ISyncMgrSyncCallback_ReportEvent, shell.ISyncMgrSyncCallback_ReportEvent, syncmgr/ISyncMgrSyncCallback::ReportEvent
syncmgr.h
Windows
Windows Vista [desktop apps only]
Windows Server 2008 [desktop apps only]
Syncmgr.idl
Windows
19H1
ISyncMgrSyncCallback::ReportEvent
syncmgr/ISyncMgrSyncCallback::ReportEvent
c++
APIRef
kbSyntax
COM
Syncmgr.h
ISyncMgrSyncCallback.ReportEvent

ISyncMgrSyncCallback::ReportEvent

-description

Provides an event to add to the Sync Results folder for an item being synchronized.

-parameters

-param pszItemID [in]

Type: LPCWSTR

A pointer to a buffer that contains the unique ID of the item currently being synchronized. This string is of maximum length MAX_SYNCMGR_ID including the terminating null character.

-param nLevel [in]

Type: SYNCMGR_EVENT_LEVEL

A value from the SYNCMGR_EVENT_LEVEL enumeration declaring the type of event involved.

-param nFlags [in]

Type: SYNCMGR_EVENT_FLAGS

Not used.

-param pszName [in]

Type: LPCWSTR

A pointer to a buffer that contains the name of the event.

-param pszDescription [in]

Type: LPCWSTR

A pointer to a buffer that contains a description of the event.

-param pszLinkText [in]

Type: LPCWSTR

A pointer to a buffer that contains the text to be used in a hyperlink to the item. This parameter can be NULL

-param pszLinkReference [in]

Type: LPCWSTR

A pointer to a buffer that contains the URL of the item. This parameter can be NULL

-param pszContext [in]

Type: LPCWSTR

Handler-specific data to associate with the event.

-param pguidEventID [out]

Type: GUID*

When this method returns, contains a pointer to a unique ID for the event.

-returns

Type: HRESULT

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

-remarks

For the handler to provide more details to the user about the sync result, the property sheet for individual sync results reported by the handler can be extended.

This method replaces LogError.

The event is stored only in memory, so all events are cleared when the user logs off or shuts down. This is one reason to implement a custom ISyncMgrEventStore, which can provide its events from anywhere, including a file, over the network, or the registry. The sync results folder, however, shows events provided both by the internal event store and by custom event stores provided by sync handlers.

Examples

The following example shows the usage of ISyncMgrSyncCallback::ReportProgress by the Synchronize method.

STDMETHODIMP CMyDeviceHandler::Synchronize(...)
{
    ...
    // Get the event receiver interface.
    ISyncMgrEventReceiver *pEventReceiver = NULL;
    hr = pCallback->QueryInterface(IID_ISyncMgrEventReceiver,
                                   (void **) &pEventReceiver);

    ...

    // Start synchronizing the sync item.

    ...

    // Generate a GUID for this item.
    // Construct a string to display in the Sync Results folder.
    // Store the information about this event so we can display more details.
    // Report the event to Sync Center.
    hr = pEventReceiver->ReportEvent(pszItemID,
                                     SYNCMGR_EL_INFORMATION,
                                     SYNCMGR_EF_NONE,
                                     pszEventName,
                                     pszEventDescription,
                                     NULL,
                                     NULL,
                                     NULL,
                                     &guidEventID);
    ...
}