0
Answer

C++ COM and C# interop

Sriram Venkatesh

Sriram Venkatesh

18y
1.8k
1
Hi,

I am using a C# interop assembly to interact with a C++ COM component.I am able to marshal BSTR* and LONG* values (which after marshalling I get as 'string' and 'int' respectively.) but dont know how to pass my own C++ class objects.
I would like to know how to pass objects created in a C++ COM server to a C# Client and vice versa. Should the object that I am passing, also be a COM component?,or Should it be in a COM container?. A simple example in C++ would suffice.

Thanks And Regards,
Sriram Venkatesh