2 Replies Last post: Sep 5, 2008 7:20 PM by Colt Covington  
Colt Covington   2 posts since
Aug 21, 2008
Currently Being Moderated

Aug 21, 2008 2:52 AM

How do I use Comfyj without a type library to generate COM stubs?

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.

Serge Piletsky TeamDev Ltd. 670 posts since
Apr 24, 2006
Currently Being Moderated
1. Sep 5, 2008 6:37 PM in response to: Colt Covington
Re: How do I use Comfyj without a type library to generate COM stubs?

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

More Like This

  • Retrieving data ...