Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. Managed C++/CLI
  4. How to use UNmanaged C++ in .NET (using managed C++)

How to use UNmanaged C++ in .NET (using managed C++)

Scheduled Pinned Locked Moved Managed C++/CLI
tutorialcsharpc++helpquestion
8 Posts 5 Posters 2 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    moist
    wrote on last edited by
    #1

    I have been looking all over without finding any proper explanation of how to use unmanaged C++ in C# with the help of managed C++. Can anyone please give a simple step by step guide how to create the projects and show what settings to fiddle around with? (Please don't give any links to MSDN, I allready checked them out and it didn't help (sure I might be stupid but not really that stupid..)). Thank you.

    T 1 Reply Last reply
    0
    • M moist

      I have been looking all over without finding any proper explanation of how to use unmanaged C++ in C# with the help of managed C++. Can anyone please give a simple step by step guide how to create the projects and show what settings to fiddle around with? (Please don't give any links to MSDN, I allready checked them out and it didn't help (sure I might be stupid but not really that stupid..)). Thank you.

      T Offline
      T Offline
      technologydude
      wrote on last edited by
      #2

      go to the below url i have tried it and it works fine good luck. http://www.codeproject.com/csharp/unmanage.asp

      M 1 Reply Last reply
      0
      • T technologydude

        go to the below url i have tried it and it works fine good luck. http://www.codeproject.com/csharp/unmanage.asp

        M Offline
        M Offline
        moist
        wrote on last edited by
        #3

        Thank you, but I'm still looking for a proper explanation of how to write wrapper classes in managed C++ for my unmanaged C++ classes. Sorry I didn't tell in the first message.

        N 1 Reply Last reply
        0
        • M moist

          Thank you, but I'm still looking for a proper explanation of how to write wrapper classes in managed C++ for my unmanaged C++ classes. Sorry I didn't tell in the first message.

          N Offline
          N Offline
          Nemanja Trifunovic
          wrote on last edited by
          #4

          moist wrote: how to write wrapper classes in managed C++ for my unmanaged C++ classes. Look here[^]

          M 1 Reply Last reply
          0
          • N Nemanja Trifunovic

            moist wrote: how to write wrapper classes in managed C++ for my unmanaged C++ classes. Look here[^]

            M Offline
            M Offline
            moist
            wrote on last edited by
            #5

            I have allready seen the so called "Migration Guide" that consists of two parts, which the first one I find completly useless. I am able to write a wrapper class, but still I wonder how you can create three different projects in a solution, one for your unmanaged c++ class that you want to wrap, a second for your managed c++ wrapper class and third a c# project that uses the wrapper class. How to do that is not included in The Migration Guide.

            B 1 Reply Last reply
            0
            • M moist

              I have allready seen the so called "Migration Guide" that consists of two parts, which the first one I find completly useless. I am able to write a wrapper class, but still I wonder how you can create three different projects in a solution, one for your unmanaged c++ class that you want to wrap, a second for your managed c++ wrapper class and third a c# project that uses the wrapper class. How to do that is not included in The Migration Guide.

              B Offline
              B Offline
              Bo Hunter
              wrote on last edited by
              #6

              You mean to tell me that all this is over knowing how to add projects to a solution?

              M 1 Reply Last reply
              0
              • B Bo Hunter

                You mean to tell me that all this is over knowing how to add projects to a solution?

                M Offline
                M Offline
                moist
                wrote on last edited by
                #7

                Yes. Let's say that you have some nice C++ classes you implemented some while ago and that you want to use them in your C# project. I can't figure out how to create a new solution from scratch and then create three different projects; one unmanaged for your old C++ classes, a managed C++ project for your wrapper and a third for your C#. I guess the main problem I have is to choose the proper settings for the unmanaged project since there are no such thing as a unmanaged C++ class library. I beleived that this was a trvial task, but I still don't know how to get it working. Thanks for the replies.

                R 1 Reply Last reply
                0
                • M moist

                  Yes. Let's say that you have some nice C++ classes you implemented some while ago and that you want to use them in your C# project. I can't figure out how to create a new solution from scratch and then create three different projects; one unmanaged for your old C++ classes, a managed C++ project for your wrapper and a third for your C#. I guess the main problem I have is to choose the proper settings for the unmanaged project since there are no such thing as a unmanaged C++ class library. I beleived that this was a trvial task, but I still don't know how to get it working. Thanks for the replies.

                  R Offline
                  R Offline
                  Randhir Sinha
                  wrote on last edited by
                  #8

                  1. Wrap your unmanaged C/C++ code in a static library. 2. Make a Managed C++ DLL project, with all the Managed C++ wrapper classes. Link with the static library created in 1. 3. Use the DLL created in step 2, in a C# project of your choice. It will work 100%.

                  1 Reply Last reply
                  0
                  Reply
                  • Reply as topic
                  Log in to reply
                  • Oldest to Newest
                  • Newest to Oldest
                  • Most Votes


                  • Login

                  • Don't have an account? Register

                  • Login or register to search.
                  • First post
                    Last post
                  0
                  • Categories
                  • Recent
                  • Tags
                  • Popular
                  • World
                  • Users
                  • Groups