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. C / C++ / MFC
  4. Using STANDARD C++ within another Projects like C#

Using STANDARD C++ within another Projects like C#

Scheduled Pinned Locked Moved C / C++ / MFC
csharpc++questionvisual-studio
6 Posts 4 Posters 0 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.
  • C Offline
    C Offline
    cppwxwidgetsss
    wrote on last edited by
    #1

    Hi I want to use a C++ program as a part of a project in C# and I know how can I do this when the program is Managed CPP But I want to know how can I include my Standard Cpp code in a C# project and I use Visual Studio 2008 and I want to know is there any template for creating a standard CPP project apart from the "Empty Project"? I appreciate your answers thank you :)

    M _ R 3 Replies Last reply
    0
    • C cppwxwidgetsss

      Hi I want to use a C++ program as a part of a project in C# and I know how can I do this when the program is Managed CPP But I want to know how can I include my Standard Cpp code in a C# project and I use Visual Studio 2008 and I want to know is there any template for creating a standard CPP project apart from the "Empty Project"? I appreciate your answers thank you :)

      M Offline
      M Offline
      Madhu Nair 0
      wrote on last edited by
      #2

      Better check here[^] :thumbsup:

      1 Reply Last reply
      0
      • C cppwxwidgetsss

        Hi I want to use a C++ program as a part of a project in C# and I know how can I do this when the program is Managed CPP But I want to know how can I include my Standard Cpp code in a C# project and I use Visual Studio 2008 and I want to know is there any template for creating a standard CPP project apart from the "Empty Project"? I appreciate your answers thank you :)

        _ Offline
        _ Offline
        _Superman_
        wrote on last edited by
        #3

        You cannot directly use native C++ code in C#. You can create a native C++ DLL and then do DLL interop from C#.

        «_Superman_» I love work. It gives me something to do between weekends.

        C 1 Reply Last reply
        0
        • _ _Superman_

          You cannot directly use native C++ code in C#. You can create a native C++ DLL and then do DLL interop from C#.

          «_Superman_» I love work. It gives me something to do between weekends.

          C Offline
          C Offline
          cppwxwidgetsss
          wrote on last edited by
          #4

          Thank you It would be better if you told me how to do that and again thank you

          _ 1 Reply Last reply
          0
          • C cppwxwidgetsss

            Hi I want to use a C++ program as a part of a project in C# and I know how can I do this when the program is Managed CPP But I want to know how can I include my Standard Cpp code in a C# project and I use Visual Studio 2008 and I want to know is there any template for creating a standard CPP project apart from the "Empty Project"? I appreciate your answers thank you :)

            R Offline
            R Offline
            Rajesh R Subramanian
            wrote on last edited by
            #5

            Hi, I'll recommend that you write everything in managed code, or everything in native language as much as possible. If you mix them both, you don't get the best of both worlds, but in most cases, you get the worst of both worlds. Like the other person said, you cannot directly use C++ code in a managed application. Try converting that to managed C++. Keep COM interop as the last option (there are several articles on CP and msdn, if you decide to, just do a search).

            It is a crappy thing, but it's life -^ Carlo Pallini

            1 Reply Last reply
            0
            • C cppwxwidgetsss

              Thank you It would be better if you told me how to do that and again thank you

              _ Offline
              _ Offline
              _Superman_
              wrote on last edited by
              #6

              Here is one such tutorial. http://dotnetperls.com/Content/DllImport-Interop.aspx[^] And you will find lots of it on MSDN.

              «_Superman_» I love work. It gives me something to do between weekends.

              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