Is it possible to generate a Type Library from a C++ header file?

  • Thread starter Thread starter Guillermo López Alejos
  • Start date Start date
G

Guillermo López Alejos

Guest
Hi,



This is my first post in this forum, I hope it won't be the last
emotion-1.gif




I have recently started working in a project in which we need to re-implement a COM component with .NET . The problem is that the project involves a client of this COM component that is not .NET aware and that is maintained by an external vendor, hence we don't have control over it. This client component is implemented with COM.



This scenario requires implementing a .NET component that is binary compatible with the COM client.



As far as I have investigated, I need to get an Interop Assembly. Since the COM client vendor does not provide us with a Primary Interop Assembly, it is necessary to build my own Interop Assembly. Running the tlbimp.exe tool on the provided VENDOR.DLL returns [FONT=Courier New, Courier, Monospace]TI0000[/FONT] error code ([FONT=Courier New, Courier, Monospace]not a valid type library[/FONT]). I guess there is not type information in that .DLL.


I've tried generating the Type Library from the header files provided by our vendor in two different ways (I’m using MS Visual Studio 2005):

  • Using the midl.exe tool (raises compilation errors)
  • Building a COM component that implements the interfaces defined in the header files and importing the result in a .NET project (again [FONT=Courier New, Courier, Monospace]TI0000 not a valid type library[/FONT] error)

My questions are: is it possible to instruct Visual Studio 2005 to generate a Type Library from a COM project? Does anyone have knowledge about different solutions?



Thanks in advance,



Guillermo

Continue reading...
 
Back
Top