vss intializefor backup fails with return code E_UNEXPECTED
Posted
by suresh
on Stack Overflow
See other posts from Stack Overflow
or by suresh
Published on 2010-05-04T22:14:35Z
Indexed on
2010/05/04
22:18 UTC
Read the original article
Hit count: 554
#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;
}
in the above program intializeforbackup fails with error code E_UNEXPECTED. The VSS service is running . In the event log it shows as "Volume Shadow Copy Service error: Unexpected error calling routine CoCreateInstance. hr = 0x800401f0.".. Any solutions for the InitializeForBackup to return S_OK?
© Stack Overflow or respective owner