c++.net and c++ unmanaged

Started by
8 comments, last by MaulingMonkey 18 years, 10 months ago
How similar are the two. Meaning if I write a program in c++.net and encapsule all my .net specific things(gui special objects) in a namespace is it sufficient to change this namespace to move the program to unmanged. Basically are there any differences in syntax? Another question: Are there syntactical differences in DX managed and unmanaged. with c++?
Advertisement
Yes, there is a difference, both in syntax, and in the general way in which the software operates.

While moving between managed and unmanaged code is eaisest (and has the fewest syntatical differences) if you use managed/unmanaged C++, it is not, in itself, an easy task.


I have tried using .NET for all my GUI-type objects and unmanaged code for my actual "engine" type software. It was unpleasent and I decided to use all unmanaged code with wxWidgets instead.

The small ammount of difficulty of using wxWidgets (which has no WYSIWYG editor) was far outweighed by the huge ammount of difficulty in interoperating managed and unmanaged code.


Basically - if you want to use .NET stuff, it's really an all-or-nothing thing (unless you want to do it the "hard" way). Either your entire project is managed, or you drop .NET and make an entirely unmanaged project.
Quote:Original post by Andrew Russell
I have tried using .NET for all my GUI-type objects and unmanaged code for my actual "engine" type software. It was unpleasent and I decided to use all unmanaged code with wxWidgets instead.


Thats why MS have ditched Managed C++, came up with a new standardized language & language binding C++/CLI, as of this moment its still being finalized and the only compiler (currently) implements it is VS/C++ .NET 2005. It is much more pleasant [grin].

Hmm, thats bad news and seriously unnecessary. I hope microsoft fixes this.
So c++/CLI will be interchangable?
I can get VS.net 2005 from my university. However I heard it isnt completely stable or compatible or something is this true?

-CProgrammer
Well it's in beta so it does have some problems, however I've found it to be pretty stable and perfectly fine for normal use.
Quote:Original post by CProgrammer
Hmm, thats bad news and seriously unnecessary.


I take it as good news and it was necessary as Managed C++ was MS only and more like a complete hack, C++/CLI is ECMA standard soon to be ISO standardized (i think Joint ISO standard).

Quote:Original post by CProgrammer
I hope microsoft fixes this.


Did you mean fix Managed C++? if so that wont happen, .NET 2005 will be backwards compatible with Managed C++ because of legacy code while developers move to C++/CLI but Mangaed C++ will fade away into a memory no one wants to remember [lol].

Quote:Original post by CProgrammer
So c++/CLI will be interchangable?


interchangable with Managed C++ or standard C++?

if former i'm pretty sure you can mix Managed C++ & C++/CLI no problem.

if latter, C++/CLI is a pseudo superset of the current C++ standard (2003 TC1), if you use anything not in standard C++ its not portable to normal C++ compilers, but C++/CLI itself is portable and portable with other CLI languages, it will be easy to use with C#, J#, VB.NET etc and visa-versa. You can also quite easily mix unmanaged and managed code in C++/CLI.

Quote:Original post by CProgrammer
I can get VS.net 2005 from my university. However I heard it isnt completely stable or compatible or something is this true?


VS and VC++ .NET 2005 are both in second beta quite stable but its still not final release.

Here is the most recent draft of the standard and if you goto MS's site you can find some video tutorials on C++/CLI.

[Edited by - snk_kid on June 2, 2005 6:18:29 AM]
Well, it depends on what you mean, CProgrammer.

"Interchangable" - No. Not directly. You will have to make some modifications*.
"Interoperable" - Yes, but it's difficult.


* - A brief read of the C++/CLI document snk_kid linked shows that there will be less (perhaps no) changes necessaray for C++/CLI than for Managed C++. Also that interoperability may be eaiser too.
Quote:Original post by Andrew Russell
* - A brief read of the C++/CLI document snk_kid linked shows that there will be less (perhaps no) changes necessaray for C++/CLI than for Managed C++. Also that interoperability may be eaiser too.


You can certainly use the fundamental concepts learnt in Managed C++ to C++/CLI as most of it is the same but there are new things to learn.

It is bascially a new language you can think of it as C++ plus new keywords to allow C++ to gel well in managed environments, new components/libraries etc.

Generics + templates do kinda rock [smile], i'm still waiting to play with STL.NET.
Quote:I take it as good news and it was necessary as Managed C++ was MS only and more like a complete hack, C++/CLI is ECMA standard soon to be ISO standardized (i think Joint ISO standard).
Not that it matters, because it will be a massive task to implement, and will only be useful to people looking to develop for Microsoft Windows.
Quote:Original post by Anonymous Poster
Quote:I take it as good news and it was necessary as Managed C++ was MS only and more like a complete hack, C++/CLI is ECMA standard soon to be ISO standardized (i think Joint ISO standard).
Not that it matters, because it will be a massive task to implement, and will only be useful to people looking to develop for Microsoft Windows.

http://mono-project.com/Main_Page

When will these people learn that "CLI/.NET" != "Windows only" ...

*sighs*

This topic is closed to new replies.

Advertisement