tags:

views:

311

answers:

5

Hello everyone,

I am very interested in how modern Windows software is written in C++ nowadays? I asked my friend who had worked on Windows software and he told that last things he worked with were MFC and then WTL. He said that MFC is no longer anything modern but WTL is still used but he didn't know much more. He also said that WTL wasn't that modern and before that he programmed in pure Windows API.

How does one write software for Windows Vista or Windows 7? Do you still use WTL, what about MFC and pure Windows API? Or are there other libraries now?

I don't know much about it, but has C# or other .NET languages replaced C++ in writing modern Windows software?

Thanks, Boda Cydo.

+6  A: 

Have a look at Qt -- you may like it. Unless of course you prefer a something non-portable version. But even if you don't plan to build on OS X, Linux, phones, ... the Qt framework is well written, well documented and just works. The SDK now includes a nice IDE (Qt Creator) too.

Dirk Eddelbuettel
+7  A: 

WTL, Qt, wxWidgets are used pretty common.

  • They all allow rapid GUI development and are pretty versatile (third option, to my mind, takes more time to get used to). Second and third options are really cool because they're cross-platform.

  • Writing windows in pure WinAPI is extremely oldschool but sometimes could be entertaining.

  • C# approach to building windows is even more rapid compared to previous options, but is a bit less flexible.

Kotti
+6  A: 

From what I've seen over the past several years:

  • WTL is on a lifeline. Abandoned by Microsoft, picked up by fans and there were several very dedicated followers. Very clean, but the learning curve is steep and the fan base dwindling. The Yahoo group is not very active. I can't recommend it.

  • MFC got another lease on life when MSFT released the feature pack. Rather extensive and a bit un-MFC-ish, it has strong support for skinning, docking layouts and ribbons. I thought it was going to be wildly popular but never did see a lot of devs jumping on it. MSDN forum questions have been sparse. If you have an existing MFC codebase then definitely take a look. Another MFC refresh for VS2010 with Win7 features added, it does stay the company's base UI solution.

  • wxWidgets is still around. No personal experience, but Lord, the few practitioners I've heard from are bitching up a storm. Real bitter stuff too.

  • Qt has been around for quite a while but picked up stream considerably, especially in the last year. Whomever uses it really likes it. It is moving beyond the confines of a UI class library as well, their users are looking actively for solutions to common programming tasks that start with the letter Q. That's a powerful vote of confidence.

But if you are on a Microsoft stack, none of these class libraries is where the real UI development is at. WPF is the elephant in the room, it's capabilities are a hundred miles beyond what's listed above. Its ability to break device and paradigm boundaries are powerful, writing code that runs on a desktop as well as a web browser as well as a phone is hard to beat. But C++ is not part of that.

Hans Passant
I am going to take a look at WPF. Thanks!
bodacydo
I use QT and loathe it. Apparently I'm in the minority. It's the most inefficient GUI framework I've ever seen, especially when it comes to using CSS style sheets for skinning. Creating a dozen CSS-skinned button widgets on an i7 takes over 1000 ms. Its support on OS X is also pretty shoddy. The MOC adds very noticeably to compile times, and it has a terrible memory management model. Regardless, it's among the best we have when it comes to cross-platform frameworks when it comes to providing GUIs, threading, networking, etc. all in one.
+1  A: 

In .NET (C#, VB.NET, ...), the cutting edge of GUI programming is WPF at the moment (replacing WinForms). Compiled code in .NET is actually CIL which is compiled into native code at runtime by the JIT. This has the advantage that you do not have to care about 64 or 32 bit target systems.

In C++, Qt seems a good solution as it is cleanly designed and provides a big bunch of services. What I dislike in Qt is its compile round trip, it is so slow, there is a moc compiler, the compiler, then link, it takes ages compared to C#/.NET to get the executable. On the other side you may encounter it even in embedded systems, what makes it interesting in such cases.

I would advice you to have at least a look C#/.NET and experiment with it before deciding.

jdehaan
+1  A: 

WTL everytime if your main platform is Windows. Google Chrome uses it, Spotify use it. Its the most productive, flexible, isn't a resource hog. By flexible I mean you can use it with pure Win32 API code / other C++ code without too much difficulty.