本文整理汇总了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);
}
}
示例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);
}
}