Managed C++

I’ve started experimenting with Managed C++ again. I never really considered it a serious tool because generally I like the C# language better, and my previous experiments with trying to take an existing C++ app and turn it into a Managed C++ app have been painful and generally fruitless.

But somewhere at the PDC, I saw something (vague huh) that said you could make just part of a C++ application managed. So I loaded up a large MFC app, selected a single random file in the middle of it and turned on the /clr switch. I also had to turn off /ZI (reduced it to /Zi), and turn off the runtime checks, but once that was done, it compiled, linked, and still ran.

Next test was to add a call to some managed code into my C++ and that worked perfectly as well.

This is great for consuming .NET objects from C++ since you can just use them without having to do any tricks at all… but I’m starting to see that trying to mix C++ and Managed C++ in the same application is not going to be easy.

One of the problems is that even though I can put a C++ object in a .cpp file, I can’t expose that object via a header file, since the syntax required would be illegal in standard C++. The Managed C++ object would only be accessible if you wrapped it in some standard C++ object and the rest of the code used that instead.

Another problem is that reflection doesn’t work the way it does for a completely managed app. You can’t really reflect against a mixed binary – Assembly.Load barfs trying to load it. This is too bad, since if it worked, you’d be able to write unit tests to test an unmanaged C++ application in Managed C++ and then use NUnit or something like it to run the tests. NUnit depends on reflection to find tests, so it won’t work in this case.

2 Responses to “Managed C++”

  1. J. Daniel Smith Says:

    Are you using the existing Managed C++ or the new C++/CLI available in Visual Studio 2005? There is considerable difference between the two…C++/CLI looks to be a big improvement.

  2. stevex Says:

    I’m using Managed C++ although I’m really looking forward to C++/CLI. I’d like to know if C++/CLI changes the way managed objects live in unmanaged DLLs or executables.

Leave a Reply

 




 
buy cheap Endep online buy cheapest Endep and Endep how to order Amitriptyline online without prescription buy Amitriptyline without rx from us pharmacy online Amitriptyline purchase purchase online prescription Amitriptyline without purchasing Amitriptyline online without prescription order generic Amitriptyline buy Endep no prescriptions how to order Endep online without prescription comprare Endep generico Endep online buy Endep in england buy cheap Endep online free consult Endep purchased online without prescription what is Endep Endep tabletten buy Endep no perscription cod Endep non rx fedex overnight free want to buy Anafranil in usa Aricept overdose buy discount Aricept on line Aricept buy Aricept online Aricept order buy Aricept pills Nizoral suppliers cheap order rx Nizoral canada Nizoral order Nizoral usa cod comprar Nizoral generico buy Nizoral 200 mg buy cheap Nizoral under without rx buy cheap Nizoral with dr. prescription Prozac 200 mg buy Lisinopril australia el Nizoral generico buy Lisinopril tablets without rx next day delivery Lisinopril with no script buy Lisinopril c o d purchase arimidex no scams order Arimidex order amex Arimidex canadian pharmacy buy Arimidex without doctor order rx free Arimidex buy Abilify with american express buy Abilify cod order Finpecia without a prescription cheap order rx Finpecia purchase Famvir no visa online without prescription buy Famvir paypal without rx buy Famvir without Famvir without prescription medications Famvir without persription purchase Famvir online no membership overnight shipping Famvir no physician approval Amitriptyline purchase order Amitriptyline free next day airAmitriptyline on line Valtrex no rx needed cod accepted buy next day Fluoxetine buy Fluoxetine line purchase Fluoxetine cod delivery buy Fluoxetine 20 mg purchase Fluoxetine buy cheap Fluoxetine under without rx purchase Fluoxetine visa without prescription Fluoxetine by mail Fluoxetine for pets Fluoxetine 10mg Amitriptyline purchase online how to order Famvir online without a rx Prozac Amitriptyline no perscription Famvir next day purchase Anafranil no prescription cheap buy cheapest Anafranil next day delivery on Anafranil saturday Anafranil buy Anafranil buy Anafranil overnight where to purchase Anafranil no prescription no fees Anafranil drug buy Lisinopril where Lisinopril buy on line order Lisinopril online no membership overnight shipping no prescription required for Lisinopril order maxalt cash on delivery Maxalt from canada buy cheapest Maxalt purchase Maxalt visa without prescription buy Maxalt uk Maxalt 10 mg purchase Maxalt no visa online without prescription purchase generic Lisinopril online Lisinopril no prescription to buy maxalt order online no membership overnight how to get a arimidex rx Aricept without a perscription fedex Aricept overnight without a prescription Donepezil prescription order buy genuine Aricept Aricept uk sales prescription Proscar buy Proscar pay cod Maxalt apotheke buy no perscription Proscar purchase Proscar online buy cheap fedex Prednisone maxalt with no presciption buy Maxalt shipped cod Proscar online Prednisone order buy Amitriptyline with amex Accutane 40 mg delivered overnight buy brand Accutane 40 mg Accutane 40 mg orderd online without prescription where to purchase generic Accutane 40 mg online without a rx how to get 40 mg Accutane without next day delivery 40 mg Accutane with no script buy Amitriptyline online Accutane 40 mg online no prescription buy Accutane 40 mg online us pharmacy Accutane 40 mg best buy buy Accutane 40 mg c o d order 40 mg Accutane cash on delivery no presciption 40 mg Accutane