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#
  4. c++ code on C# project

c++ code on C# project

Scheduled Pinned Locked Moved C#
questioncsharpc++data-structures
5 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.
  • S Offline
    S Offline
    Semion_N
    wrote on last edited by
    #1

    Hello, Can I write a c++ code on my c# project? I mean if I have an array (a) on c# and I want to make something with this array but on c++ code how can I do that? I mean How can I mix the two languages togather?

    SnaidiS(Semion)

    D C L S 4 Replies Last reply
    0
    • S Semion_N

      Hello, Can I write a c++ code on my c# project? I mean if I have an array (a) on c# and I want to make something with this array but on c++ code how can I do that? I mean How can I mix the two languages togather?

      SnaidiS(Semion)

      D Offline
      D Offline
      Dave Kreskowiak
      wrote on last edited by
      #2

      Semion_N wrote:

      Can I write a c++ code on my c# project

      No. A project can only be written in a single language, be it C++, C#, VB.NET, ... But, there's nothing stopping you from having multiple projects in your Solution, each written in a seperate language.

      Dave Kreskowiak Microsoft MVP - Visual Basic

      1 Reply Last reply
      0
      • S Semion_N

        Hello, Can I write a c++ code on my c# project? I mean if I have an array (a) on c# and I want to make something with this array but on c++ code how can I do that? I mean How can I mix the two languages togather?

        SnaidiS(Semion)

        C Offline
        C Offline
        Christian Graus
        wrote on last edited by
        #3

        You can mix languages in a solution, just write your C++ code in a C++/CLI dll and call it from C#.

        Christian Graus - Microsoft MVP - C++ Metal Musings - Rex and my new metal blog

        1 Reply Last reply
        0
        • S Semion_N

          Hello, Can I write a c++ code on my c# project? I mean if I have an array (a) on c# and I want to make something with this array but on c++ code how can I do that? I mean How can I mix the two languages togather?

          SnaidiS(Semion)

          L Offline
          L Offline
          Luc Pattyn
          wrote on last edited by
          #4

          This is how I understood it (and I recall I once did a small but successful test combining C#, VB.NET and J#): You can create a dll in one .NET language, and another dll or exe in another .NET language. for each of these you need a project (that is possible in a single solution). Now the second project can call on the dll from the first project, and they can exchange all "CLR types" which covers most of the data types in a .NET language (I think the biggest limitation is on VB.NET, not sure tho). :)

          Luc Pattyn

          1 Reply Last reply
          0
          • S Semion_N

            Hello, Can I write a c++ code on my c# project? I mean if I have an array (a) on c# and I want to make something with this array but on c++ code how can I do that? I mean How can I mix the two languages togather?

            SnaidiS(Semion)

            S Offline
            S Offline
            Semion_N
            wrote on last edited by
            #5

            Thank you all for your answers. Do I have to make a dll from the other projects if I want to use the classes and ect on my C# project?

            SnaidiS(Semion)

            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