当前位置: 首页>>代码示例>>C++>>正文


C++ CComPtr::AbortBackup方法代码示例

本文整理汇总了C++中CComPtr::AbortBackup方法的典型用法代码示例。如果您正苦于以下问题:C++ CComPtr::AbortBackup方法的具体用法?C++ CComPtr::AbortBackup怎么用?C++ CComPtr::AbortBackup使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在CComPtr的用法示例。


在下文中一共展示了CComPtr::AbortBackup方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: Cleanup

void Cleanup(bool bAbnormalAbort, bool bSnapshotCreated, const CString& mountedDevice, CComPtr<IVssBackupComponents> pBackupComponents, GUID snapshotSetId)
{
    if (pBackupComponents == NULL)
    {
        return; 
    }

    if (bAbnormalAbort)
    {
        OutputWriter::WriteLine(TEXT("Aborting backup."), VERBOSITY_THRESHOLD_NORMAL);
        pBackupComponents->AbortBackup(); 
    }
    if (!mountedDevice.IsEmpty())
    {
        if (bAbnormalAbort)
        {
            CString message;
            message.AppendFormat(TEXT("Dismounting device: %s"), mountedDevice);
            OutputWriter::WriteLine(message, VERBOSITY_THRESHOLD_NORMAL);
        }
        BOOL bWorked = DefineDosDevice(DDD_REMOVE_DEFINITION, mountedDevice, NULL); 
        if (!bWorked)
        {
            DWORD error = ::GetLastError(); 
            CString errorMessage; 
            Utilities::FormatErrorMessage(error, errorMessage); 
            CString message; 
            message.AppendFormat(TEXT("There was an error calling DefineDosDevice during Cleanup. Error: %s"), errorMessage); 
            OutputWriter::WriteLine(message);
        }
    }
    if (bSnapshotCreated)
    {
        if (bAbnormalAbort)
        {
            OutputWriter::WriteLine(TEXT("Deleting snapshot."), VERBOSITY_THRESHOLD_NORMAL);
        }
        LONG cDeletedSnapshots; 
        GUID nonDeletedSnapshotId; 
        pBackupComponents->DeleteSnapshots(snapshotSetId, VSS_OBJECT_SNAPSHOT_SET, TRUE, 
            &cDeletedSnapshots, &nonDeletedSnapshotId); 
    }
}
开发者ID:EntityReborn,项目名称:shadowspawn,代码行数:43,代码来源:ShadowSpawn.cpp

示例2: Cleanup

void Cleanup(bool bAbnormalAbort, bool bSnapshotCreated, CComPtr<IVssBackupComponents> pBackupComponents, GUID snapshotSetId)
{
	if (pBackupComponents == NULL)
	{
		return;
	}

	if (bAbnormalAbort)
	{
		pBackupComponents->AbortBackup();
	}
	if (bSnapshotCreated)
	{
		LONG cDeletedSnapshots;
		GUID nonDeletedSnapshotId;
		pBackupComponents->DeleteSnapshots(snapshotSetId, VSS_OBJECT_SNAPSHOT_SET, TRUE,
			&cDeletedSnapshots, &nonDeletedSnapshotId);
	}
}
开发者ID:YY583456235,项目名称:VSSCopy,代码行数:19,代码来源:VssCopy.cpp


注:本文中的CComPtr::AbortBackup方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。