1

I have a C# COM DLL and I want to call its methods throught c++ methods.

How do I make this?

1 Answer 1

3

Ask VisualStudio to generate the typelib or use regasm.exe /tlb to generate the typelib, then import it into the C++ project with #import directive.

Sign up to request clarification or add additional context in comments.

3 Comments

After importing the generated tlb, how can I access to the functions. Can you give me some code example plz
After importing the typelib you get a bunch of interfaces in it. Use those interfaces. Use CoCreateInstance() to instantiate objects.
Check the MSDN docs for the _com_ptr_t class, that's the base class for the smart interface pointers.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.