C++ and C# question (urgent)

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • VJ
    Moderator
    • Mar 2001
    • 9733

    #1

    C++ and C# question (urgent)

    Hello,

    I have an urgent question for regarding the project I'm working on.

    We made all our "working code" in Visual C++, expecting to be able to plug it into another application. As it turns out, this other application only supports Visual C# for easy plugin of own code...

    I'm now trying to make a dll of the C++ code, and while I can export functions, I seem to run into issues with classes.
    Dumpbin shows that there are classes exported in the dll, but can I use them in C#? If so, how?


    Thanks!


    Jörg
    pixar
    Dream as if you'll live forever. Live as if you'll die tomorrow. (James Dean)
  • VJ
    Moderator
    • Mar 2001
    • 9733

    #2
    I have made a managed wrapper class in C++, and compiled it with the /CLR option.

    In Visual C#, I have added the DLL as a library, and while it now accepts it: I can declare a variable of this type and access the methods, but the methods don't seem to have any effect (they also don't show up in the object browser)...


    Jörg
    Last edited by VJ; 29 September 2008, 02:44.
    pixar
    Dream as if you'll live forever. Live as if you'll die tomorrow. (James Dean)

    Comment

    • VJ
      Moderator
      • Mar 2001
      • 9733

      #3
      Found it...
      The "solution" in Visual Studio for my wrapper class had to be templated of "Visual C++ | CLR | Class library".
      pixar
      Dream as if you'll live forever. Live as if you'll die tomorrow. (James Dean)

      Comment

      • cjolley
        Super MURCer
        • Aug 1999
        • 7672

        #4
        Glad we could help.
        Ask any time.
        Chuck
        秋音的爸爸

        Comment

        • VJ
          Moderator
          • Mar 2001
          • 9733

          #5



          Jörg
          pixar
          Dream as if you'll live forever. Live as if you'll die tomorrow. (James Dean)

          Comment

          Working...