Skip to content

Latest commit

 

History

History
126 lines (100 loc) · 4.08 KB

nf-syncmgr-isyncmgrsynccallback-cancontinue.md

File metadata and controls

126 lines (100 loc) · 4.08 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.CanContinue
ISyncMgrSyncCallback::CanContinue (syncmgr.h)
Determines whether the synchronization has been canceled.
CanContinue
CanContinue method [Windows Shell]
CanContinue method [Windows Shell]
ISyncMgrSyncCallback interface
ISyncMgrSyncCallback interface [Windows Shell]
CanContinue method
ISyncMgrSyncCallback.CanContinue
ISyncMgrSyncCallback::CanContinue
_shell_ISyncMgrSyncCallback_CanContinue
shell.ISyncMgrSyncCallback_CanContinue
syncmgr/ISyncMgrSyncCallback::CanContinue
shell\ISyncMgrSyncCallback_CanContinue.htm
shell
02106b6f-4c1c-4bd6-b120-2948b1e6d25c
12/05/2018
CanContinue, CanContinue method [Windows Shell], CanContinue method [Windows Shell],ISyncMgrSyncCallback interface, ISyncMgrSyncCallback interface [Windows Shell],CanContinue method, ISyncMgrSyncCallback.CanContinue, ISyncMgrSyncCallback::CanContinue, _shell_ISyncMgrSyncCallback_CanContinue, shell.ISyncMgrSyncCallback_CanContinue, syncmgr/ISyncMgrSyncCallback::CanContinue
syncmgr.h
Windows
Windows Vista [desktop apps only]
Windows Server 2008 [desktop apps only]
Syncmgr.idl
Windows
19H1
ISyncMgrSyncCallback::CanContinue
syncmgr/ISyncMgrSyncCallback::CanContinue
c++
APIRef
kbSyntax
COM
Syncmgr.h
ISyncMgrSyncCallback.CanContinue

ISyncMgrSyncCallback::CanContinue

-description

Determines whether the synchronization has been canceled.

-parameters

-param pszItemID [in]

Type: LPCWSTR

A pointer to a buffer containing the ID of the item.

-returns

Type: HRESULT

Return Value Meaning
S_OK A cancellation has not been requested. The synchronization can continue.
S_FALSE A cancellation has been requested. The handler should call ISyncMgrSyncCallback::ReportProgress, specifying SYNCMGR_PS_CANCELED in the nStatus parameter.
E_INVALIDARG The value pointed to by pszItemID is either unknown to Sync Center or is not an item managed by this handler.
 

If pszItemID is NULL or an empty string, the return value depends on whether a cancellation has been requested for the entire handler.

-remarks

A synchronization can be canceled by the user by clicking the Stop or Stop All task on the context menu or the command module. It can also be canceled when an application calls one of the stop methods of the ISyncMgrControl interface.

By implementing this functionality as a separate method, the handler can check for a cancellation without reporting progress.

Examples

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

HRESULT CMyDeviceHandler::Synchronize(...)
{
    ...

    // Start synchronizing the sync items.

    ...

    // If a cancellation has been requested, stop the sync and exit.
    if (pCallback->CanContinue(pszItemID) == S_FALSE)
    {
        // End the sync operation and exit the function.
        hr = pCallback->ReportProgress(pszItemID,
                                       pszCancelMessage,
                                       SYNCMGR_PS_CANCELED,
                                       uCurrentStep,
                                       uMaxStep,
                                       NULL);
    }
    ...
}