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. MC++ & C++

MC++ & C++

Scheduled Pinned Locked Moved Managed C++/CLI
csharpdotnetc++visual-studioquestion
8 Posts 5 Posters 18 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.
  • A Offline
    A Offline
    Anonymous
    wrote on last edited by
    #1

    hi all, I am confused about the concept of mixing MC++ with normal C++. If I want to produce a C++ application that is compatible with the .NET framework and compiles to IL and so on .. can I by ANY MEANS use unmanaged C++ in it ? either by wrapping, by just putting it there, by using __nogc, or by any other way ? if there is/are way/s .. plz. state them. this is one, the other thing is : is there any free IDE available on the internet that can compile MC++ ? (either has a compiler or uses cl.exe from M$ .NET framework) -- something like SharpDevelop for C# but to use with MC++ thanx

    N 1 Reply Last reply
    0
    • A Anonymous

      hi all, I am confused about the concept of mixing MC++ with normal C++. If I want to produce a C++ application that is compatible with the .NET framework and compiles to IL and so on .. can I by ANY MEANS use unmanaged C++ in it ? either by wrapping, by just putting it there, by using __nogc, or by any other way ? if there is/are way/s .. plz. state them. this is one, the other thing is : is there any free IDE available on the internet that can compile MC++ ? (either has a compiler or uses cl.exe from M$ .NET framework) -- something like SharpDevelop for C# but to use with MC++ thanx

      N Offline
      N Offline
      Nish Nishant
      wrote on last edited by
      #2

      Anonymous wrote: If I want to produce a C++ application that is compatible with the .NET framework and compiles to IL and so on .. can I by ANY MEANS use unmanaged C++ in it ? Yes, in fact you can produce IL without using any MC++ at all. You can compile an MFC/ATL project with the /clr option and it'll produce an IL executable. Anonymous wrote: is there any free IDE available on the internet that can compile MC++ ? None that I am aware of. Regards, Nish


      Author of the romantic comedy Summer Love and Some more Cricket [New Win] Review by Shog9 Click here for review[NW]

      A 1 Reply Last reply
      0
      • N Nish Nishant

        Anonymous wrote: If I want to produce a C++ application that is compatible with the .NET framework and compiles to IL and so on .. can I by ANY MEANS use unmanaged C++ in it ? Yes, in fact you can produce IL without using any MC++ at all. You can compile an MFC/ATL project with the /clr option and it'll produce an IL executable. Anonymous wrote: is there any free IDE available on the internet that can compile MC++ ? None that I am aware of. Regards, Nish


        Author of the romantic comedy Summer Love and Some more Cricket [New Win] Review by Shog9 Click here for review[NW]

        A Offline
        A Offline
        Anonymous
        wrote on last edited by
        #3

        Wow ! u mean I CAN compile unmanaged C++ into IL ? why the managed extensions then ?! what about STL and Standard C++ ?

        J 1 Reply Last reply
        0
        • A Anonymous

          Wow ! u mean I CAN compile unmanaged C++ into IL ? why the managed extensions then ?! what about STL and Standard C++ ?

          J Offline
          J Offline
          James T Johnson
          wrote on last edited by
          #4

          Anonymous wrote: Wow ! u mean I CAN compile unmanaged C++ into IL ? No; Nish mis-spoke. The /clr switch allows you to use managed extensions in your C++ application. Anything that isn't managed is written as x86 while the managed stuff is written as IL. There are some weird occurances that happen with regard to using the gcroot template on an unmanged class; but for the most part what I said above is correct. You can verify this by opening such an application up with ildasm. James "Java is free - and worth every penny." - Christian Graus

          N 1 Reply Last reply
          0
          • J James T Johnson

            Anonymous wrote: Wow ! u mean I CAN compile unmanaged C++ into IL ? No; Nish mis-spoke. The /clr switch allows you to use managed extensions in your C++ application. Anything that isn't managed is written as x86 while the managed stuff is written as IL. There are some weird occurances that happen with regard to using the gcroot template on an unmanged class; but for the most part what I said above is correct. You can verify this by opening such an application up with ildasm. James "Java is free - and worth every penny." - Christian Graus

            N Offline
            N Offline
            Nish Nishant
            wrote on last edited by
            #5

            James T. Johnson wrote: No; Nish mis-spoke. The /clr switch allows you to use managed extensions in your C++ application. Anything that isn't managed is written as x86 while the managed stuff is written as IL. Yeah, but I didn't totally mis-speak :-) Take an MFC app. Apply /clr. Compile and build it. Not one line of managed code. Yet it won't run on a machine without the .NET runtime. Dunno why! The unmanaged code gets compiled to unmanaged code alright. But there is a basic IL stub that is generated. Maybe it does some elementary initialization. Nish


            Author of the romantic comedy Summer Love and Some more Cricket [New Win] Review by Shog9 Click here for review[NW]

            J 1 Reply Last reply
            0
            • N Nish Nishant

              James T. Johnson wrote: No; Nish mis-spoke. The /clr switch allows you to use managed extensions in your C++ application. Anything that isn't managed is written as x86 while the managed stuff is written as IL. Yeah, but I didn't totally mis-speak :-) Take an MFC app. Apply /clr. Compile and build it. Not one line of managed code. Yet it won't run on a machine without the .NET runtime. Dunno why! The unmanaged code gets compiled to unmanaged code alright. But there is a basic IL stub that is generated. Maybe it does some elementary initialization. Nish


              Author of the romantic comedy Summer Love and Some more Cricket [New Win] Review by Shog9 Click here for review[NW]

              J Offline
              J Offline
              Joel Lucsy
              wrote on last edited by
              #6

              With /clr switch the exe/dll automatically creates a dependence on mscoree.dll which is a .NET dll. It won't run without it and you can't delayload mscoree.dll. Joel Lucsy (jjlucsy@ameritech.net)

              N 1 Reply Last reply
              0
              • J Joel Lucsy

                With /clr switch the exe/dll automatically creates a dependence on mscoree.dll which is a .NET dll. It won't run without it and you can't delayload mscoree.dll. Joel Lucsy (jjlucsy@ameritech.net)

                N Offline
                N Offline
                Nick Hodapp
                wrote on last edited by
                #7

                /clr tells the compiler to generate MSIL, or "managed code", which runs in the context of the CLR. Once you compile with /clr, you can consume any managed datatypes, from the .NET Framework, or some other library. /clr DOESN't take your C++ datatypes and make them "managed data". They're still allocated and destroyed by you, from the C++ or Win32 heap. To create your own "managed data types" (garbage collected, and consumable by other managed applications) you need to apply some of the managed-extension keywords; primarily __gc. You can also use #pragma managed and #pragma unmanaged to control within a module what code is compiled to MSIL, and what is compiled to x86. Nick This posting is provided “AS IS” with no warranties, and confers no rights. You assume all risk for your use. © 2001 Microsoft Corporation. All rights reserved.

                J 1 Reply Last reply
                0
                • N Nick Hodapp

                  /clr tells the compiler to generate MSIL, or "managed code", which runs in the context of the CLR. Once you compile with /clr, you can consume any managed datatypes, from the .NET Framework, or some other library. /clr DOESN't take your C++ datatypes and make them "managed data". They're still allocated and destroyed by you, from the C++ or Win32 heap. To create your own "managed data types" (garbage collected, and consumable by other managed applications) you need to apply some of the managed-extension keywords; primarily __gc. You can also use #pragma managed and #pragma unmanaged to control within a module what code is compiled to MSIL, and what is compiled to x86. Nick This posting is provided “AS IS” with no warranties, and confers no rights. You assume all risk for your use. © 2001 Microsoft Corporation. All rights reserved.

                  J Offline
                  J Offline
                  Joel Lucsy
                  wrote on last edited by
                  #8

                  You are correct. The point, however, was that the /clr switch creates a dependance on mscoree.dll whether or not you use any "managed code/data". Joel Lucsy (jjlucsy@ameritech.net)

                  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