Accessing COM objects developed in C#

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have written a bit of C# code that I wish to have access to from some
unmanaged C++ code I am writing. I have written a COM interface for the
classes and their methods, but I cannot manage to get access to them in the
C++ code. I am doing something wrong, but I do not know what.

I have the C# COM objects broken down into a .tlb file.

Given this file, what do I need to do in C++ to gain access to the classes?

The class is called XXXPacket, and the interface is IXXXPacket. The method
is Populate.

Any help would be appreciated.

thanks

Andrew S. Giles
 
Andrew said:
I have written a bit of C# code that I wish to have access to from
some unmanaged C++ code I am writing. I have written a COM interface
for the classes and their methods, but I cannot manage to get access
to them in the C++ code. I am doing something wrong, but I do not
know what.

I have the C# COM objects broken down into a .tlb file.

Given this file, what do I need to do in C++ to gain access to the
classes?

The class is called XXXPacket, and the interface is IXXXPacket. The
method is Populate.

Any help would be appreciated.

See if

http://www.codeproject.com/dotnet/COM_DOTNET_INTEROP.asp

and

http://www.codeproject.com/dotnet/cominterop.asp

are of any help.

-cd
 
Back
Top