Using a converted type library (.tlb) in C#

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • davexxyz
    New Member
    • Aug 2008
    • 1

    Using a converted type library (.tlb) in C#

    Hello all,

    I am very new to COM and have to develop a C# application which needs functions implemented by one another application. What I have now are .exe and a type library (.tlb) of the desired application so I decided to use the tlbimp to generate a wrapper class from .tlb and added the generated dll file to my project.



    I hoped this class would act as an interface class between my project and the app I want to invoke its function and the compilation was passed without any error.

    But once I created an instance of the imported COM class, my application got thrown an Exception (Runtime Exception(0x800 40154)) which seemed to show there’s any problem of registering COM component.( I guess)



    Since, I have no any dll in my hands; I have no idea what to register??



    I also tried using the regsvr32.exe and regasm.exe to register the generated dll file and I got “no entry point for the dll” for regsvr32. For regasm, the result message showed that the registration seems to be successful but I still get the same exception whenever an instance of the COM class is newed up.



    I would be very glad if there is someone who could help me.

    I appreciate any suggests.



    Thank you, Dave
Working...