   Windows UI in C++
  Maybe not the best forum to ask, but I don't visit any other programming related forums really (don't I just suck?!). Given that there are lots of programmers here, I hope to find a few with experience in this area.I'm looking for a way to make a Windows UI with forms and all kinds of fancy controls in C++ (preferrably VS 2005). I have worked with the .NET UI and the controls are beatifull (nice XP-style) and the implementation is very nice. I have tried using MFC and it gave me nightmares. Is there an alternative? My requirements are that the controls are as nice as they come with .NET 2.0 and that the implementation is as nice as well.   
  Erm..., why not use .NET and C# then? If there is some weird reason why you cannot use C#, I would recommend using C++/CLI, which can take advantage of the .NET framework as well.   ;  I've heard wxWidgets is pretty good.Quote: Erm..., why not use .NET and C# then?If there is some weird reason why you cannot use C#, I would recommend using C++/CLI, which can take advantage of the .NET framework as well.I would guess that this particular person probably has a good reason, considering his past work.   ;  There are a couple of other UI toolkits out there that you can evaluate.One of them is called Qt.  It is free for non-commercial/open source usage, otherwise if you want to ship a commercial product you need to purchase the commercial license version.Another toolkit is called wxWidgets (formerly wxWindows, but MS made them change the name).  wxWidgets is free, open source and comes with a permissive license (your application doesn't have to be open source like GPL would force you to do).wxWidgets will implement its UI using the native controls where possible and fallback to generic controls when the underlying platform doesn't provide the facility.  I have attempted to use MFC and it always gives me a headache for anything beyond the simplest of UI.  wxWidgets to me looks like a viable alternative and I selected it for a cross-platform project I'm working on.Qt renders everything from the bottom up itself.  Therefore the UI looks close, but not 100% correct on every platform.  This is why Qt-based applications have always looked just a bit incorrect to me.For me, wxWidgets was the choice I made because of the license issue with Qt -- Qt doesn't support VS.NET unless you buy the commercial version -- and that wxWidgets uses the native UI components wherever possible.There is a book on programming with wxWidgets that is very useful in understanding how to write programs with wxWdidgets, particularly if you're not already familiar with an existing UI framework like Motif or MFC.   ;  Another one for you to investigate: gtkmm is the one I've come across that is most closely aligned to my "C++ philosophy". That is, it uses modern idioms and resource handling techniques and just generally feels more 'solid' than anything else I've used.That said, its widgets don't always look native, though the Windows port is pretty reasonable.It's LGPL, if that matters. I've used it with MSVC 2005, MinGW and gcc on the Mac (though it looks horid on the Mac -- drops back to Motif)I've been meaning to investigate Adobe's Adam and Eve stuff (see the 'Libraries' heading), but haven't got around to it, yet. It looks pretty tight, but I don't know how close to production ready it is, or even if they're using it in any of their products.   ;  There is a discussion within the wxWidgets community to make a new version of the API that they say "uses modern C++ idioms", except that they don't bother to say what they think "modern C++ idioms" are, which left me wondering what they were talking about.What idioms are you referring to and was wxWidgets something you evaluated?   ;Quote:Original post by legalize[...] they don't bother to say what they think "modern C++ idioms" are [...]What idioms are you referring to and was wxWidgets something you evaluated?The last time I looked at wxWidgets was a couple of years ago. It would be unfair to comment on that toolkit right now.But here's a summary of what I mean by "modern idioms", which may or may not align with those discussed by the wxWidgets community:Type safetyRAII and exception safetyNo naked pointers, unless absolutely necessary. Resources are owned by objects. You should never be expected to do manual cleanupJudicious use of templates and generics to enable extensibility, customisability and improve type safetyNot shying away from RTTI without good reason The adoption of patterns and idioms common in the C++ standard library (iterators/algorithms, for example) and Good integration with the C++ standard library (Qt reimplements pseudo-equivalents for half of the standard library, for example -- and poorly, IMHO)Use of namespaces by this I mean, I've often seen toolkits implement their own RTTI mechanism. I tend to ignore it and use dynamic_cast<> if it's really needed -- and it often it won't be if designed using these pratctices.;Quote:Original post by the_eddBut here's a summary of what I mean by "modern idioms", which may or may not align with those discussed by the wxWidgets community:Type safetyRAII and exception safetyNo naked pointers, unless absolutely necessary. Resources are owned by objects. You should never be expected to do manual cleanupJudicious use of templates and generics to enable extensibility, customisability and improve type safetyNot shying away from RTTI without good reason The adoption of patterns and idioms common in the C++ standard library (iterators/algorithms, for example) and Good integration with the C++ standard library (Qt reimplements pseudo-equivalents for half of the standard library, for example -- and poorly, IMHO)Use of namespaces by this I mean, I've often seen toolkits implement their own RTTI mechanism. I tend to ignore it and use dynamic_cast<> if it's really needed -- and it often it won't be if designed using these pratctices.By "type safety", I'm assuming you mean things like not using void *?  I mean, C++ is strongly typed, moreso than C, so you should have type safety by default unless you actively subvert it with things like void *.I think wxWidgets currently meets most of those requirements, although it doesn't use namespaces and it does have its own RTTI mechanism, but it does more than dynamic_cast<>.  I mean, C++'s RTTI doesn't really provide much, its not anything like reflection in Java/.NET.  They do encapsulate resources within objects.  They do use C++ standard library style idioms (although again, it predates the C++ Standard Library, so they have some elements that are parallel to std::vector<>, but you're not forced to use them).  They don't use generics except for a few small places.  I'm not sure how a UI library would look with templates, i.e. what it would get you.  In general I didn't find wxWidgets to leave a bad taste in my mouth and I seem to find myself constantly advocating use of the standard library.   ;WTL is a decent library for UI development.The nice thing about WTL is that it requires no external libraries to be included with the program. You can also modify any component, as the source is included. And, it's based on standard Win32 libraries. There's are plenty of articles and tutorials on WTL development.   ;  Win32 API is still a mostly viable choice.  Sure its not cross platform, but if you want a .NET like UI without using .NET most of the Win32 UI doodads support the XP theme.   