#include "vss.h"
#include "vswriter.h"
#include <VsBackup.h>
#include <stdio.h>
#define CHECK_PRINT(result) printf("%s\n",result==S_OK?"S_OK":"error")
int main(int argc, char* argv[])
{
BSTR xml;
LPTSTR errorText;
IVssBackupComponents *VssHandle;
HRESULT result = CreateVssBackupComponents(&VssHandle);
CHECK_PRINT(result);
result = VssHandle->InitializeForBackup();
printf("unexpected%x\n",result);
system("pause");
return 0;
}
在上述程序中,initializeforbackup 失败,错误代码为 E_UNEXPECTED。VSS 服务正在运行。在事件日志中,它显示为“卷影复制服务错误:调用例程 CoCreateInstance 时出现意外错误。hr = 0x800401f0。”.. InitializeForBackup 返回 S_OK 的任何解决方案?