How to create a C++ class to have a .NET interface

  • Thread starter Thread starter Sam Carleton
  • Start date Start date
S

Sam Carleton

There is a 3rd party library that is a bit complex, has a number
of functions and structs and variable length data, the whole bit.
I saw Eric Gunnerson's July 14, 2002, article "Using Existing Code
in C#". He talks about four different ways to wrap the code in
C++, the last one is: "Modifying a C++ class to have a .NET
interface", but he never talks about how to actually do this. Can
anyone point me to documentation about how to do this?

Sam
 
Sam said:
There is a 3rd party library that is a bit complex, has a number
of functions and structs and variable length data, the whole bit.
I saw Eric Gunnerson's July 14, 2002, article "Using Existing Code
in C#". He talks about four different ways to wrap the code in
C++, the last one is: "Modifying a C++ class to have a .NET
interface", but he never talks about how to actually do this. Can
anyone point me to documentation about how to do this?

You can use managed extensions (MC++) to wrap an unmanaged class. The
managed wrapper can then be used in C# or other managed code.
 
You can use managed extensions (MC++) to wrap an unmanaged
class. The managed wrapper can then be used in C# or other
managed code.

Wonderful! Can you give me the title of an MSDN Document to get
me pointed in the right direction? So far, the best I have been
able to find is: "Interoperating with Unmanaged Code" From what
it looks like to me, this only deals with calling an unmanaged
DLL, not wrapping a unmanaged C++ class in a managed C++ class.

Sam
 
Back
Top