Click here to Skip to main content
16,008,175 members
Home / Discussions / Managed C++/CLI
   

Managed C++/CLI

 
GeneralRe: MFC app - porting Pin
MattG10-Dec-02 9:28
MattG10-Dec-02 9:28 
GeneralRe: MFC app - porting Pin
Maximilien10-Dec-02 13:43
Maximilien10-Dec-02 13:43 
GeneralRe: MFC app - porting Pin
MattG10-Dec-02 14:03
MattG10-Dec-02 14:03 
GeneralLinker Errors Pin
Paul Ingles8-Dec-02 12:23
Paul Ingles8-Dec-02 12:23 
GeneralRe: Linker Errors Pin
Nick Parker9-Dec-02 15:17
protectorNick Parker9-Dec-02 15:17 
Questionans required? Pin
imran_rafique7-Dec-02 9:44
imran_rafique7-Dec-02 9:44 
GeneralC++ vs. Managed C++ Pin
SanShou6-Dec-02 4:50
SanShou6-Dec-02 4:50 
GeneralRe: C++ vs. Managed C++ Pin
Jeff J6-Dec-02 12:55
Jeff J6-Dec-02 12:55 
I do not flame others, so you'll have to get your heat elsewhere Smile | :)

Managed C++ is essentially an extension to the .Net framework stuff (the Common Language Runtime, etc.), in C++ syntax. It is possible to put regular C++ and MC++ in the same project (even the same file). MC++ exposes the same runtime library as all other CLR-based languages, such as C#. Thus, much of the difference between MC++ and C#, is that MC++ exposes the existence of pointers, and C# calls them "reference objects" and bypasses the pointer syntax.

Picking up C# with a C++ background is really easy, and even easier if you have experience with Java. Several new keywords, but most of the stuff is the same. I cannot call using MC++ really changing, as it's more adapting to using some CLR library objects in a familiar syntax. Any class you define as a __gc class, you can use CLR objects in. There is no MFC, ATL, or Win32 API directly in the CLR itself, though you can write wrapper declarations around external DLL functions, and call them from within any .Net code. The CLR is comprehensive, so you won't often have to anyway.

Performance wise, there is little difference between the CLR-base languages, though MC++ allows integration with regular C++, which Microsoft freely admits will remain the speed demon for many things. Well, COM objects still suffer weight problems and circular references, and traditional heap allocation is not as fast as .Net's garbage collected (GC) heap. .Net objects are lightweight and 'new' allocation is really fast, although low-level manipulation is harder with .Net. However, it is possible in C# (research the unsafe and fixed keywords), and MC++ has the best access, although pinning GC memory (keeping it from moving) has a slight penalty. Thus, MC++ has some advantages, but C# is the cleanest syntax.

Some main benefits to CLR-based stuff is rapid development, greater platform independence, a good GUI designer, a good security model, web integration, and the like. Considering such a wide scope, the performance is pretty good, but not higher performance overall than C++. The CLR languages do not replace C++, they are simply better suited to certain tasks and projects.

Naturally, I expect to be flamed as well. Anyone can find an excuse to argue. If every man who's been put on fire stays warm for the rest of his life, then call me Mr. Toasty...

Cheers
GeneralRe: C++ vs. Managed C++ Pin
Nitron7-Dec-02 12:49
Nitron7-Dec-02 12:49 
GeneralRe: C++ vs. Managed C++ Pin
SanShou9-Dec-02 11:02
SanShou9-Dec-02 11:02 
GeneralRe: C++ vs. Managed C++ Pin
Nick Parker7-Dec-02 5:08
protectorNick Parker7-Dec-02 5:08 
GeneralRe: C++ vs. Managed C++ Pin
SanShou9-Dec-02 11:05
SanShou9-Dec-02 11:05 
GeneralRe: C++ vs. Managed C++ Pin
Nick Parker11-Dec-02 9:47
protectorNick Parker11-Dec-02 9:47 
GeneralWriting COM accesible objects in Managed C++ Pin
tlemoine5-Dec-02 15:18
tlemoine5-Dec-02 15:18 
GeneralRe: Writing COM accesible objects in Managed C++ Pin
Jonathan [Darka]13-Dec-02 3:22
professionalJonathan [Darka]13-Dec-02 3:22 
GeneralRe: Writing COM accesible objects in Managed C++ Pin
Jonathan [Darka]13-Dec-02 3:24
professionalJonathan [Darka]13-Dec-02 3:24 
GeneralAmbiguous calls Pin
Soni3-Dec-02 20:20
Soni3-Dec-02 20:20 
GeneralRe: Ambiguous calls Pin
Alexandru Savescu3-Dec-02 21:57
Alexandru Savescu3-Dec-02 21:57 
GeneralRe: Ambiguous calls Pin
Soni4-Dec-02 0:11
Soni4-Dec-02 0:11 
GeneralForm Handle Pin
Jeff J2-Dec-02 10:33
Jeff J2-Dec-02 10:33 
GeneralRe: Form Handle Pin
Kannan Kalyanaraman3-Dec-02 3:53
Kannan Kalyanaraman3-Dec-02 3:53 
GeneralRe: Form Handle Pin
Jeff J3-Dec-02 13:06
Jeff J3-Dec-02 13:06 
GeneralC++ plotting routine Pin
amica29-Nov-02 12:34
amica29-Nov-02 12:34 
QuestionHow to Change the Icon from the TitleBar Pin
Peter Fonk27-Nov-02 22:34
Peter Fonk27-Nov-02 22:34 
AnswerRe: How to Change the Icon from the TitleBar Pin
Jeff J2-Dec-02 15:41
Jeff J2-Dec-02 15:41 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.