Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Alternative to MFC [closed]

Tags:

https://stackoverflow.com/questions/149698/what-is-a-good-mfc-starting-book

A lot of the upvoted comments claim there are much better alternatives. I'd like to know what they might be.

My main requirement is that the UI use the native widgets so that our automation software can work. Owner drawn windows are much harder to drive.

I'm not particularly liking the design of MFC so an alternative would be good. Only one I've found is WX, which is the one we've already tried and are considering abandoning. We need something that doesn't force us to fight with a bunch of cross-platform wrapping we don't care about. We're writing a Windows application and marketing doesn't give one single crap about targeting Mac or Linux (yeah, it makes my butt hurt too).

I've looked at the .NET option a little bit. Problem is I don't know much about it but from what I can tell we'd have to use C# to get a lot of the options readily available with MFC. The C++/CLI toolkit doesn't seem to have docking windows on first glance for instance. In fact, a straight up WinFroms option doesn't seem to either. It looks like we'd have to make a WPF project and that doesn't appear to be at all what we really want (and we'd have a huge bunch of crap to learn besides just another toolkit). Moving out of C++ would also require a lot of wrapping and I don't particularly like the results I've seen from automated wrappers.

The other issue I have with the .NET option is that we've got a pretty drawing intense application (in addition to requiring a lot of forms). I know that you can get similar results with JIT languages like .NET but I also know you've got to be a lot more careful to do so. It's an issue I'd like to avoid worrying about at this time.

The other, and probably most important issue with .NET (at least switching languages) is that we've got a huge supply of interface logic that though should be API agnostic, is very much written in C++.

So what are the other options? Do these people really have points or are they just yelling against anything that isn't their favorite language or toolkit?

NOTE:
What is the issue here?? I said specifically that porting to other platforms is NOT even remotely a consideration and that I HAVE TO HAVE something that uses the native widget set so we don't have to completely change everything that testing uses to automate the product!!!! Did anyone actually read my question?

like image 500
Edward Strange Avatar asked Nov 02 '10 17:11

Edward Strange


People also ask

What can I use instead of MFC?

Win32++ is a simple and easy to understand library for creating Windows applications. It runs on the commonly available free compilers, making it a free alternative to MFC. Win32++ has been designed to make life a little easier for those learning to use C++ to program using the Windows API directly.

Is MFC still relevant?

MFC is still used for some new development, and a lot of maintenance development (including inside of Microsoft). While it can be minutely slower than using the Win32 API directly, the performance loss really is tiny -- rarely as much as a whole percent.

Is MFC worth learning?

It's useful if you are employed somewhere that uses MFC. Otherwise, it's totally irrelevant. You'd be better learning about the raw Win32 API and how MFC/WinForms/WPF wrap around (or don't wrap around) it. I guess @KerrekSB was joking on the likely future of Windows8.

Does Microsoft support MFC?

You can create MFC or ATL programs with Visual Studio Community Edition or higher. The Express editions do not support MFC or ATL.


2 Answers

Qt is the only real answer for a C++ based gui toolkit at the moment (at least for full desktop apps). Even for purely windows apps it's worth it - it also has excellent integration with visual studio (get the vs-addin) and is very well documented

wx has some nice points, one being it's very similar to MFC in use, but with Qt going LGPL wx's real advantage has been lost.

Edit Qt widgets aren't native HOWEVER they do use the native styling APIs so that they are indistinguishable from native widgets - if you use the default styles.

like image 200
Martin Beckett Avatar answered Oct 11 '22 12:10

Martin Beckett


Windows forms will work just fine with C++/CLI. Windows forms also happens to be a wrapper around WIN32 handles.

There's no difference in the capabilities of C#/Windows Forms compared to C++/Windows Forms. (They just compile differently) Just like you can do the same things with C# and VB.NET...

If you're looking for docking windows, there are a number of third party libraries that do this. (Some are open source, some you can buy.) Because of the CLR, you can directly include assemblies written in a different language.

like image 39
Matt Brunell Avatar answered Oct 11 '22 12:10

Matt Brunell