Hi everyone,
It's a few days now that I have searched this site as well as lots of other sites, couldn't resolve my problem yet. I try to make it brief:
-Background:
I am creating a C++ client for a COM component written in VB. The COM developer has provided me with the dll and the IDL file. I am trying to create a .tlb out of the IDL file to include it in my C++ client.
-What should I mention about the IDL file:
The idl file has a importlib statements:
there are a bunch of methods in the IDL file that either take a pointer to this interface as an input ( [in] _Collection* ) or a pointer to pointer as an output ([out, retval] _Collection**)
-What have I done?
I have setup an ATL project, included the above mentioned .idl file to it and tried to compile it to get the .h and .tlb files. I had to include this line in the stdafx.h to make it compile:
The project compiles successfully. Now I expect that a pointer to the _Collection interface will be avaiable through the .tlb file.( The created .tlb file is named "mtinterface.tlb".)
-What is the exact problem?
So far everything looks ok. I have set up a C++ console client and the first thing I imported is the .tlb file created from the .idl:
I have also provided a copy of the "msvbmv60.dll" in the current directory. Now as soon as I compile the project I get a series of this kind of errors:
"C:\mtinterface.tlh(600) : error C2501: '_CollectionPtr' : missing storage-class or type specifiers "
As you see the mtinterface.tlh does not recognize a smart pointer to the _Collection interface. So it seems the type library of the external dll (msvbmv60.dll) is not available to the mtinterface.tlh.
I appreciate any ideas and suggestions.
Thanks
It's a few days now that I have searched this site as well as lots of other sites, couldn't resolve my problem yet. I try to make it brief:
-Background:
I am creating a C++ client for a COM component written in VB. The COM developer has provided me with the dll and the IDL file. I am trying to create a .tlb out of the IDL file to include it in my C++ client.
-What should I mention about the IDL file:
The idl file has a importlib statements:
Code:
importlib("msvbvm60.dll"); //For the _Collection interface
there are a bunch of methods in the IDL file that either take a pointer to this interface as an input ( [in] _Collection* ) or a pointer to pointer as an output ([out, retval] _Collection**)
-What have I done?
I have setup an ATL project, included the above mentioned .idl file to it and tried to compile it to get the .h and .tlb files. I had to include this line in the stdafx.h to make it compile:
Code:
#import "msvbvm60.dll" no_namespace rename("EOF", "adoEOF") rename("RGB", "adoRGB")
-What is the exact problem?
So far everything looks ok. I have set up a C++ console client and the first thing I imported is the .tlb file created from the .idl:
Code:
##import "MTinterface.tlb"
"C:\mtinterface.tlh(600) : error C2501: '_CollectionPtr' : missing storage-class or type specifiers "
As you see the mtinterface.tlh does not recognize a smart pointer to the _Collection interface. So it seems the type library of the external dll (msvbmv60.dll) is not available to the mtinterface.tlh.
I appreciate any ideas and suggestions.
Thanks