MC++ & C++
-
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
-
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
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]
-
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]
-
Wow ! u mean I CAN compile unmanaged C++ into IL ? why the managed extensions then ?! what about STL and Standard C++ ?
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
-
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
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]
-
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]
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)
-
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)
/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.
-
/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.
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)