Wrapper Class

  • Thread starter Thread starter Jim
  • Start date Start date
J

Jim

Does anyone know of a solid tutorial on how to write a wrapper class for a
C++ class in C#? I read through the Process Invoke docs in MSDN. I've
checked out the C# example in the Windows Media Format SDK. I've also
realized that I'll have to use DLLImport to get the C++ unmanaged classes
into the wrapper.

But I'm looking for a, "Here we go for the first time" writing a Wrapper
class in C# for a C++ class.

thanks
 
Jim,
Does anyone know of a solid tutorial on how to write a wrapper class for a
C++ class in C#?

If the class is not already exposed to COM, I'd say that you don't.
Write the wrapper in Managed C++ instead. P/Invoke works fine for
calling static DLL entry points, but for classes and more complex
object models, C++ interop (IJW) is the way to go.


microsoft.public.dotnet.languages.vc would be the best group to get
more help on this. Here's a pretty good intro article to the subject

http://www.oreillynet.com/pub/a/dotnet/2003/03/03/mcppp2.html



Mattias
 
Back
Top