I am attempting to use Microsoft Volume Shadow Copy Service. Everything is defined within the VssApi.dll
I have tried using the Code Generator for ComfyJ and it fails with "COM object method returns error code: 0x80029C4A; Error loading type library/DLL."
You call a standard exported DLL method, which I can do via JNIWrapper, but that method returns an IVssBackupComponents COM object.
HRESULT CreateVssBackupComponents(__out IVssBackupComponents **ppBackup)
http://msdn.microsoft.com/en-gb/library/aa381517.aspx
Now how do I work with this COM object without having stubs since the Code Generator doesn't work?
I have looked every where and am convinced there is no type library that defines the COM object.
Hi Colt,
Sorry for the delay in replying.
Apparently that error occurs because VssApi.dll does not export any Type library. And you can get the same error if you try to open that library with COM/OLE Object Viewer application.
Of course, the possible solution in this case would be to download and install Vss SDK from Microsoft site. But after reviewing the sources it turned out that IVssBackupComponents is not defined as a public interface, but just as a C++ class, which can be accessed by the C++ applications only:
// backup components interface
class __declspec(uuid("665c1d5f-c218-414d-a05d-7fef5f9d5c86")) IVssBackupComponents : public IUnknown {
By the way, the same problem was discussed already in several Internet forums and blogs, for example: http://www.alphaleonis.com/2008/08/alphavss-bringing-windows-shadow-copy-service-vss-to-net/
So, one of the possible solutions in this case is to create the required wrapper by hand. Or, you can try the create the a new IDL file with such interface defined, compile it to TLB and then run the Codegen application for it.
Please let me know if you have any further questions.
-Serge
Thanks Serge.
I had eventually reached the same conclusion. I tried writing my own wrapper by hand and couldn't figure out. Your idea about creating my own TLB is a great idea. I may have to try that.
My solution for now is to use WMI to access the Volume Shadow Copy Service. It doesn't offer a complete interface to VSS but it gets the job done.
Thanks again.