Wrapper Class

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Jim

    #1

    Wrapper Class

    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


  • Mattias Sjögren

    #2
    Re: Wrapper Class

    Jim,
    [color=blue]
    >Does anyone know of a solid tutorial on how to write a wrapper class for a
    >C++ class in C#?[/color]

    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.publi c.dotnet.langua ges.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/dotn...03/mcppp2.html



    Mattias

    --
    Mattias Sjögren [MVP] mattias @ mvps.org

    Please reply only to the newsgroup.

    Comment

    • Mark

      #3
      Re: Wrapper Class

      "Jim" <tranzparency@y ahoo.com> wrote in
      news:uqujIGirDH A.1784@TK2MSFTN GP09.phx.gbl:
      [color=blue]
      > Does anyone know of a solid tutorial on how to write a wrapper class
      > for a C++ class in C#?
      >
      > thanks
      >
      >[/color]

      Let SWIG do it for you?

      Mark

      Comment

      Working...