C# and C++

Gibson12345

Member
Aug 31, 2002
191
0
0
I've done a bit of research on these two languages, but have been unable to discern whether C# has the tools available in C++ for building GUI's. If so, does it retain the speed of C++ in this arena (Windows applications)?
 

Nothinman

Elite Member
Sep 14, 2001
30,672
0
0
C++ has no native tools for building GUIs. MS included tools to help build GUIs using MFC in Visual C++.

C# is supposed to be easier with the new Windows.Forms libraries, I havn't really looked at it though so I can't say but I would think anything would be less convoluted than MFC =)
 

Descartes

Lifer
Oct 10, 1999
13,968
2
0
As Nothinman noted, you can build GUIs in C++ in MFC. This makes building GUIs in C++ simpler, or more difficult, depending on your perception of MFC.

I often employ MFC simply for the message mapping facilities. In other words, I'd rather have a simple OnSomeEvent(...) method than have to handle the actual message from the queue in the WndProc. I build the interfaces using VC++ 6's resource editor. It's really quite easy and I can insert ActiveX controls, etc.. Granted, it's dialog-based, but it works for most cases.

Nothinman was correct; Windows Forms is the new GUI paradigm for .NET. *All* .NET languages have access to Windows Forms, so you can build them in C# just as you can in C++ (called "managed C++" under .NET). Visual Studio .NET lacked a designer for Windows Forms when using managed C++; however, it's in Visual Studio .NET 2003. C# of course has the designer, as does VB.NET, etc..

Whether you use C# or managed C++ is entirely up to you. You can of course mix unmanaged C++ with managed C++ in the same project, or even the same translation unit. You simply oscillate between unmanaged and managed code using two pragmas: unmanaged and managed. :)

Hope that gives you some answers.