0

I have created a dll in C# which needs to be consumed by various C++ applications. During installation of my product, I execute the regasm command to generate the .tlb file for my dll.

How can I load this tlb from my C++ application and call functions on it?

The King
  • 833
  • 1
  • 15
  • 41
  • Possible duplicate of [COM(C++) programming tutorials?](https://stackoverflow.com/questions/2938435/comc-programming-tutorials) – Alan Birtles Aug 30 '18 at 07:01
  • You should not 'load tlb file from your application', but you should import the tlb file to your C++ project (source codes). That is at least the case, when you create your own support library in C#. When you implement a standard interface *(e.g. video or audio codec)* then there is another approach. And how do you import the tlb file depends on what C++ environment/compiler are you using. The procedure is different for each environment. But the principles are the same. Your environment creates a new h file, that you include in the project. Then you load the COM using standard COM functions. – Julo Aug 30 '18 at 07:06
  • 2
    Not what you are supposed to do with a type library, use the #import directive in your C++ code. – Hans Passant Aug 30 '18 at 07:19

0 Answers0