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. Calling C++ .NET project from C# project

Calling C++ .NET project from C# project

Scheduled Pinned Locked Moved C#
csharpc++helptutorialquestion
10 Posts 3 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
    shimin
    wrote on last edited by
    #1

    ;) Hello everyone, I need to call a C++ .NET project from a C# project. Is it possible and if yes, how to go about doing it? Your help will be greatly appreciated. Thanks alot! :) min

    P 1 Reply Last reply
    0
    • S shimin

      ;) Hello everyone, I need to call a C++ .NET project from a C# project. Is it possible and if yes, how to go about doing it? Your help will be greatly appreciated. Thanks alot! :) min

      P Offline
      P Offline
      Paul Selormey
      wrote on last edited by
      #2

      What do you mean by calling C++ NET project? Best regards, Paul. Jesus Christ is LOVE! Please tell somebody.

      S 1 Reply Last reply
      0
      • P Paul Selormey

        What do you mean by calling C++ NET project? Best regards, Paul. Jesus Christ is LOVE! Please tell somebody.

        S Offline
        S Offline
        shimin
        wrote on last edited by
        #3

        I am using the Visual .NET studio to do the system .. I got this C++ project and C# project in the visual studio. I need to call the classes written in the c++ project from the C# project. thanks min

        N P 2 Replies Last reply
        0
        • S shimin

          I am using the Visual .NET studio to do the system .. I got this C++ project and C# project in the visual studio. I need to call the classes written in the c++ project from the C# project. thanks min

          N Offline
          N Offline
          Nick Parker
          wrote on last edited by
          #4

          shimin wrote: I need to call the classes written in the c++ project from the C# project. Another chance for me to push my latest article (this actually does what you are asking): Cross Language Web Service Implementation[^]


          Nick Parker

          You see the Standards change. - Fellow co-worker

          S 1 Reply Last reply
          0
          • N Nick Parker

            shimin wrote: I need to call the classes written in the c++ project from the C# project. Another chance for me to push my latest article (this actually does what you are asking): Cross Language Web Service Implementation[^]


            Nick Parker

            You see the Standards change. - Fellow co-worker

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

            I try looking thru your article but i don really understand. I am sorry, but I am just a beginner, i hope you can enlightened me.. Thanks :) min

            1 Reply Last reply
            0
            • S shimin

              I am using the Visual .NET studio to do the system .. I got this C++ project and C# project in the visual studio. I need to call the classes written in the c++ project from the C# project. thanks min

              P Offline
              P Offline
              Paul Selormey
              wrote on last edited by
              #6

              Is your C++ project written in MC++ or pure C++? If in MC++, then you do not have any problem, just compile the MC++ project into assembly and use it like any other .NET dll. Make sure your MC++ classes are marked as "public _gc..." Best regards, Paul. Jesus Christ is LOVE! Please tell somebody.

              S 1 Reply Last reply
              0
              • P Paul Selormey

                Is your C++ project written in MC++ or pure C++? If in MC++, then you do not have any problem, just compile the MC++ project into assembly and use it like any other .NET dll. Make sure your MC++ classes are marked as "public _gc..." Best regards, Paul. Jesus Christ is LOVE! Please tell somebody.

                S Offline
                S Offline
                shimin
                wrote on last edited by
                #7

                the C++ is visual C++ , can i still do what you say? and how to compilt the project into an assembly? thanks alot for your help min

                P 1 Reply Last reply
                0
                • S shimin

                  the C++ is visual C++ , can i still do what you say? and how to compilt the project into an assembly? thanks alot for your help min

                  P Offline
                  P Offline
                  Paul Selormey
                  wrote on last edited by
                  #8

                  You will have to study the .NET system a bit more. Visual C++ supports the normal C++ and the Managed Extensions to C++ (MC++). The MC++ is designed for .NET programming and the normal C++ for other systems. You cannot call the normal C++ from C# or VB.NET. But you can call MC++ classes from C# or VB.NET. Again, the question is which are you using C++ or MC++? Best regards, Paul. Jesus Christ is LOVE! Please tell somebody.

                  S 1 Reply Last reply
                  0
                  • P Paul Selormey

                    You will have to study the .NET system a bit more. Visual C++ supports the normal C++ and the Managed Extensions to C++ (MC++). The MC++ is designed for .NET programming and the normal C++ for other systems. You cannot call the normal C++ from C# or VB.NET. But you can call MC++ classes from C# or VB.NET. Again, the question is which are you using C++ or MC++? Best regards, Paul. Jesus Christ is LOVE! Please tell somebody.

                    S Offline
                    S Offline
                    shimin
                    wrote on last edited by
                    #9

                    I am really sorry that I know this much only. How do I know whether it is MC++ or C++? Cos I got this program from a Phd student and he is not available for me to query. thanks min

                    P 1 Reply Last reply
                    0
                    • S shimin

                      I am really sorry that I know this much only. How do I know whether it is MC++ or C++? Cos I got this program from a Phd student and he is not available for me to query. thanks min

                      P Offline
                      P Offline
                      Paul Selormey
                      wrote on last edited by
                      #10

                      MC++ classes are marked with "__gc". Any C++ class which is not marked with "__gc" are normal C++ classes. A simple MC++ class is as follows:

                      public __gc Test
                      {
                      Test() {}

                      };

                      It is therefore very easy to identify the MC++ classes. Best regards, Paul. Jesus Christ is LOVE! Please tell somebody.

                      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