How to revive C++ skills - c++

I was a C++ developer (mostly ATL/COM stuff) until, as many of us, I switched to C# in 2001. I didn't do much C++ programming since then.
Do you have any tips on how to revive my C++ skills? What has changed in C++ in the last years? Are there good books, articles or blogs covering the language. The problem is that most material I could find either targets people who are new to the language or those with a lot of experience.
Which C++ libraries are popular these days? I guess I will need to read on the STL because I didn't use it much. What else? Boost? ATL? WTL?

Boost - though it, and other libraries were around back then, its only relatively recently that it's taken off in a big way. Google for TR1 and c++0x standards too. You should defintely read up on STL because (IMHO) its the thing that makes C++ special.
ATL is as good a dead technology (don't get me wrong, I liked it and still use it somewhat, but its not fashionable in the MS world anymore).
Something like QT is probably more new and cool for C++ developers, and has the advantage of getting you into all the new Linux and web development that'll be increasingly popular over the next few years.
However, once you start looking at the things you can do, I think it'll all come back quite quickly.

I personally find that syntax is where i mostly need to catch up when i wander back to a language i havent used in a long time. But the concepts and what the language is about stays the same in memory.
Assuming its the same with you, i would say its a good idea to relook at the texts you remember to have been useful to you while learning C++. I would recommned Thinking in C++ for getting up fast on the syntax.
STL would be really useful yes. Thats one thing i have found commonly appreciated by all mature C++ programmers. It would be useful to know the libraries that Boost provides.
The changes to C++ world, depends on the changes your favourite compiler has decided to implement. Since you mentioned ATl/COM i assume it would be VC++. The changes to MFC would be support for Windows Forms (2005 vc++) and Vista compliant uI's and ribbon support(?) (2008 Vc++)
VC++ now supports managed C++ -i'm sure you know what that is coming from the C# world - 2008 adds supports for managed STL too.
VC++ is trying to be more standards compliant and are making some progress in that area.
They have introduced lots of secure functions that depreciate the old stds like strcpy and the compilers will also give warnings if you use the old fns.
VC++2005 also has something called function attributes, which it uses to describe the parameters so that it can do more checking on the inputs you pass in and statically flag a warning if it sees soething amiss. Usefuli would say though our shop has not progressed to using the 2005 compiler.
MSDN has the list of breaking changes for each releases. Oh & Support for Windows 95, Windows 98, Windows Millennium Edition, and Windows NT 4.0 has been removed from 2005 version of VC++. Additionally the core libraries you required till now (CRT, ATL, MFC etc) now support a new deployment model which makes them shared side sy side assemblies and requires a manifest.
This link should get you going - http://msdn.microsoft.com/en-us/library/y8bt6w34.aspx
2008 adds even more like Tr1 recommendations, more optimizning compiler, parallel compilation(/mp), support for new processor architectures etc. Open Mp support has also been enhanced in one of these versions is what i remember.
Again refer MSDN - thats the suthentic source for all the answers.
Good luck.

Definitely read the latest edition of "Effective C++" by Scott Meyers. I would also recommend "C++ Gotchas: Avoiding Common Problems in Coding and Design" by Stephen C. Dewhurst.

To sharpen your C++ skills I'd suggest going over some of your old C++ code if you still have access to it. Revisiting it will hopefully trigger those parts of your brain that have laid dormant after switching to C# :)
For libraries STL is good, then boost. I don't think there is too much new stuff going on with ATL/WTL from what you would have known back in 2001.

Just start a project. The libraries you use will depend on your project, but you should certainly read up on the STL. If you haven't used C++ for a long time you might need learn more about templates.

Pickup one of the C++ Unit Test frameworks out there (I suggest Google C++ Testing Framework, aka. gtest). Pick a small project that you can start from scratch and try some TDD. The TDD will encourage you to make small steps and to reflect on your code. Also, as you build your suite of unit tests, it gives you a base from which you can experiment with different techniques.

Rewrite some of your C# stuff using C++

For a start, I'd say try writing code that will work on both a Mac and Windows or Linux and Windows. This will force you to write code that is much more portable than the type of C++ code you can get away with on Visual C++ - there a lot of finer points that are very different when you go cross platform.
I'd suggest stay away from libraries for now if you can - perfect your ANSI C++ game first. I'd also suggest reading up on C++0x - the next standard is due soon and it would help you more to work towards that. To that end, brush up on the STL (the concepts behind it, not the implementation so much) and templates.
If you'd like to try BOOST, go ahead, but you can generally get by without using it. The reason I stayed away from it mostly is because of the way templates are used to do what is needed - a lot of which will become much easier once the new standard is introduced.
UPDATE: Once you're comfortable with the STL and start needing to do things that require a lot of code with the STL or are just plain tricky, then head over to BOOST. Buy a book on BOOST and read it and understand it well.

Take some old piece of code and add to it. This won't get you back on top of the latest C++ trends but it will get your feet wet.
At my job I had to add some features to a C++ ActiveX control and I hadn't touched C++ in years and years and have never done it professionally. Figuring out how to do it again was actually pretty damn cool.

I was in a similar situation: switched from C++ to C# in 2005 and then switched back to C++ in 2007. I can't say C++ universe really changed in those 2 years. The most crucial thing was to regain my memory-management instincts, but that can only be done by practicing.
Now that you have both C++ and .NET under your belt you might want to study C++ CLI a bit (new incarnation of late "Managed C++").
As for books, read everything with "Meyers" and "Sutter" on the cover.

Related

Making a GUI with turbo c++?

Note: I am new to programming and extremely new to c++.I have seen scouring google for a long time and only things i can come up with are external headers and very complicated code..
I want to do this at school, and there we are provided with Turbo C++. We can't bring any external headers in there, gotta work with whatever i've got.
I want to create a GUI. I want to create something really good for our annual project and i want to create a GUI.
I would like to make as detailed a GUI as possible, but would be satisfied if i can create as much as several text options and clicking on em triggers respective functions (I am sorry if thats not how GUIs work, i never worked with one).
Again help is highly appreciated, i understand most discussions on Stack Overflow are much more complicated than this, i appreciate you taking the time to read and (hopefully) answer a layman question.
I'll suggest a non-technical solution because this is actually largely not a technical problem. Much of your problem is that you have to use Turbo C++. Unfortunately, a number of poorer countries have, for some reason, stuck with extremely outdates software in education. I know because I'm originally from one of the "Turbo countries", and I know that the main technical university there still uses Turbo for undergrad courses.
This is bad. Large projects in school are there to teach you to work on software. A regular programming course should teach you to think like a programmer, and it doesn't matter what language you use. But term projects are supposed to be more practical. The problem is, with Turbo C++, not only will you fail to learn enough, you will learn things that are bad. You'd be writing a 16-bit program that takes effort to even run on modern hardware, while not being able to use the C++ language properly. The compiler is older than the first ISO C++ standard!
If you want to make an impressive project that will stand out in your studies, especially if you later want to continue at a foreign university, I urge you to talk to your professor, explain the situation, and ask if you can use something else for the project. A modern compiler with some framework like Qt. If you can reach an agreement to use something else, it will benefit you.
Otherwise, if you have no choice, get Turbo Vision. There are versions of BC++ packaged with it, or you can find it elsewhere, Turbo Vision is a fairly comprehensive interface framework for the dinosaur era.
First off, the toolchain and operating system you are using is outdated and incapable. And the language support Turbo C++ offers can hardly be called C++ at all; the code you will write will not be C++ code. At best, it will be C with classes code.
All that aside, there was a fairly-capable Text-based User Interface (TUI) library available with Turbo C++ (as well as Borland's Pascal-based toolchains,) called Turbo Vision. You might be able to use that. It generates UIs quite similar to the Turbo C++ IDE itself.
But IIRC, it was not trivial to use, so I advise you to find a book or reference or comprehensive tutorial of some kind. However, since your environment precludes anything that is not available already with TC, I see no option for you other than using Turbo Vision or writing your own, which doesn't sound like something you can do or want to do.

Using Embarcadero Borland

As I'm more and more dissapointed with VS 2010 I'm trying to find some alternative and I was looking at Embarcadero's new edition of C++ env.
Is there any point of learning new (not popular I think) product when VS practically dominates market?
Thanks.
Although I'm not really a Windows programmer, I have been using Borland/Embarcadero to-and-fro during the past 10 years. Here are my personal opinions of why you should not consider it:
The general quality of Builder has dropped significantly over the years. Borland Builder 6 was the last high-quality product, from there the IDE itself has become more and more buggy. The IDE typically crashes once per 1-2 weeks of usage.
No undo in the RAD design. Yes I know, it is quite unbelievable. Even the earliest versions of utter crap like VB had this. But Builder year 2011 doesn't! If you slip on your keyboard and accidentally alter a component, you shall be punished!
The debugger is next to useless. This might have been fixed in the latest version, but in several versions you can't single step through the program without collapsing struct/class variables in the watch window, which is of course very frustrating.
Documentation is very poor, often non-existant, and may be written in Object Pascal, even though you ordered the C++ IDE. The help files also have a tendency to linger as evil ghost processes in your computer, making it impossible to shut down Windows before the ghost is busted.
Personally I'm considering switching to Visual Studio.
I've been using both the Embarcadero Borland, now RAD Studio 2010, c++ and VS2008 every day for the last 6 months. My programming philosophy has always been to use the right tool for the project, no matter what that particular tool is. So a couple of my observations/opinions are -
Advantages
The WYSIWYG screen designer is good. It acts a lot like the WinForms editor in VS2008, but for c++. In VS2008, the only package for c++ that I've used that is close is Qt. My biggest compliant is documentation, but that applies to most software, so it isn't just their problem.
For many builtin classes, they are built on TObject class. This base class functions a lot like Object in C#. The biggest advantage this gives you as a c++ programmer, if you follow a few rules, is mostly automatic memory management. It's not garbage collection, rather, list of related objects that are deleted together.
Disadvantages-
The RAD Studio 2010 C++ environment exists primarily to support Delphi. That is their real strength anyway. Nowhere does anything say this. It is just an overall feel that I've gotten from using system.
Limited support for 3rd party libraries.
It cannot link with any Microsoft compatible c++ library. This includes both Microsoft and 3rd party libraries. They use a different "name mangling" format from Microsoft. So everything has to wrapped in a c language wrapper.
We use the Boost Libraries a lot in VS2008. But in Rad Studio, it only has limited support for Boost.
I've found the overall speed of the generated code to significantly slower than that produced by VS2008.
Please remember, that these are just one person's opinions.
I would suggest that you download a demo version of the product and try it for yourself.
If you want to be 100% up-to-date, you have to use the development environment provided by the platform's vendor.
If you do not mind waiting few months/years for new things to get ported over (or your market allows for it) then you surely you can venture into the unknown.
It's not that Borland's IDEs (unlike MS' VS family) needed any advanced training to start using them and be already productive. That is the main reason why they remain popular in many niches.

C++ for small, individual projects (i.e. hobby programming)

I recently started C++. I am using PHP right now and decided to take a look at C++. Web programming had me working with a couple of languages, with a couple of people. I wanted to do programming where I only had to bother with one language and create small utility apps (mostly not web-based). I wanted a compiled, strongly-type language without memorizing a tome of classes. Basically I wanted to learn C++ for the following:
mobile programming (I don't ever want to go touching Java, and I don't have a Mac for Objective C or IPhone SDK)
small desktop apps like DTRs, POSs
creating small desktop-based games
creating small Air-like applications that can access the web for additional content
I heard that C++ is not beginner-friendly and is mostly used for huge projects with lots of calculations and fine details (like 3D games). Is it practical or even possible for me to use C++ for the above cases? (Sorry, I haven't delved on C++ that much yet, so aside from "huge, monolithic project", I don't know any other uses for it)
You can certainly use C++ in all the areas you mention, though whether it is best of breed for any of them is open to debate. C++ is very large and complex language, and requires a fair bit of effort to get up to speed on. If I were you, I would pick one of the areas you mention that you are most interested in, and then find out which language(s) are best suited for that area and learn that.
If you are set on learning C++ you will need to read at least one book on it - you cannot learn it from internet resources alone. See this question The Definitive C++ Book Guide and List for a book list.
On the droid you can use other languages aside from Java - check out their ASE (Active Scripting Environment). C++ / C should really only be used when you have no other choice - i.e. speed critical code, operating systems etc. It's very easy to make a mistake that's difficult to diagnose and there are lots of task where it'll take way longer than it should to write and odds are others have already done so and done it way better - reinventing the wheel is bad. If it interests you though by all means learn and eventually you may master it. It's an excellent skill to have.
It's also not a completely object oriented language however, it's a hybrid one that supports most object oriented features, but some such as inheritance and polymorphism are a bit awkward to deal with in C++ - for example you have to define methods as virtual in base classes in order to be allowed to redefine them in subclasses - sort of like predicting the future - will this method every be desired to be redefined by an inheritor? Really what happens in that case is you make the base class method virtual later on to enable it to be redefinable - that is if you happen to have access to the source code to do just that - if not then oh well. For an example of this confusing stuff in C++ and other gotchas: Pitfalls
Look at other languages such as Ruby or Python - in particular Stackless Python where a combination of it and C++ (used where necessary) was used to create EVE Online as well as the functional languages such Erlang and Haskell.
For 2, 3 and 4, I recommend C# over C++, for the reasons I wrote here.
About 1, you can do iPhone development with .NET but I've never tried it and I don't know how viable it is.
Edit
To answer your actual question: yes, it's totally practical to write small and large desktop apps in C++. Especially if you use quality tools like Visual Studio and Qt. It's just that I think it'd waste a lot of your time for no reason, unless you intend to go into professional game development eventually.
I went to C++ from PHP like you, but I was more interested in 3D games and such. Now I have moved on to C# and find it much more enjoyable than C++.
As for your specific areas of interest however, C++ is certainly an option but C# may be better.
Mobile programming with C++ is probably not a good idea. I know it's possible with NDKs and such but for a beginner it's probably not so good. For iPhone development, other than the official SDK, the next best option is the (commercial) MonoTouch framework from Novell. However, you may still need a mac to deploy (I don't know). In terms of Android, if you don't want to touch Java (don't blame you) I believe a C# framework (similar to MonoTouch) is in development and other languages may be available. Other platforms? No idea.
Small desktop apps is also very possible with C++. Assuming you're running Windows, you can use the Win32 API (pain) or the C++/CLI API (better). You could also use a different GUI framework like Qt, wxWidgets or GTK+ which are all also supported on other platforms. Again coming back to C#, GUI development using GTK# in MonoDevelop is so much fun. Having used WinForms in Visual C# Express back in my Windows days, I can say that I now enjoy the process whereas I didn't before.
Games are my main area of interest and the reason I originally picked up C++. Seeing as you've said small and desktop-based, using C++ for performance reasons is way overkill IMO. You could make a decent, fun, playable game in Python using pygame without the pain of using a language like C++. In C# (yes, I'm trying to sell it to you) you could create awesome games using the XNA framework from Microsoft or other frameworks like (my personal favorite) OpenTK.
Rich internet applications. C++ is probably not the right tool to use here. It's certainly possible but seeing as C++ has no standard networking library, you would have to figure some of this stuff out yourself. C# may not be the right tool either but it makes it a little easier. There are other options as well (like Python) but it's not something I know much about.
Despite what I've said about it, I still think C++ is a good language to learn. It teaches you about lower-level things you never think about in PHP land. If you want to learn it, the book that really helped me was "C++: A beginners guide" by Herbert Schildt and also "Programming" by Bjarne Stroustrup.
Yes, your use cases can all be done with C++, more or less (YMMV on mobile devices).
To some degree or another, a language like C# will be more rapid to develop in, however.
In my opinion, once you get away from the straight-up form design features and hack for a while in a language & application, language feature comparisons begin to diminish in meaningfulness.
I recommend C++ as a first "heavyweight" language; see here for my most recent discussion on it.

Learning C++ right?

Since I have been mostly using script languages in the past time but now want to go to the "high-performance" level I decided to learn C++ some time ago.
I looked at some "beginner" tutorials and bought an O'reilly C++ pocket reference book (it's really helpful). My problem is that I now know all the basics but I'm not good enought to program a more complicated game, for example, yet.
Do I have to get one of those thick C++ books for further learning?
I'm going to use C++ on Windows mainly. What APIs beside Win32 are important for me?
My goal would be to write a small interpreter for a programming language I've though of - I managed that in several scripting languages already, what API/Library knowledge do I need in C++ to write one?
You don't need a thick book - you need a good one. Get Accelerated C++, written by Koenig & Moo, two of the original C++ development team.
Depends what you want to do.
You don't need anything - you can write a perfectly good interpreter or compiler using just the C++ Standard library. See this SO question for lots of info in this area.
Learn with books. C++ is a complex language. My suggestion is to first go with a rather quick introduction and general overview of the major programming paradigms that C++ supports: OOP and generic programming: Accelerated C++.
When you finish this book, you can go with the two volumes of Bruce Eckel's Thinking in C++ which are very detailed.
For UI programming, the best C++ toolkit is Qt, and it is multiplaform-ready. You can read "C++ GUI Programming With Qt4" (the first edition is free to download, just google it). If you want to stick with C++/Windows API, learn the Windows Template Library, altough it may be a bit hard due to lack of official documentation (altough there are good tutorials on the net). WTL is the way to go to create very small, lightweight applications (Qt DLLs on the other side, need a few MBs each).
I have always found that learning a language from a book is pretty difficult and that after you know the basics you should begin to program. So instead of picking up a thick manual I would check out something like http://www.cprogramming.com/tutorial.html#advanced or just google for c++ tutorial and something that you would like to try to make.
A good (and) thin book to get started in C++ is Accelerated C++ by Koenig and Moo.
I mainly do programming under Linux, but I hear a lot of bad things about MFC, so I'd try to find a different GUI library.
Once you get up to speed with some of the more complicated parts of C++ syntax, have a look at the Boost.Spirit libraries for parser generation. The various Boost libraries provide some very useful extensions to the Standard Library.
Honestly, In learning C++ i never picked up a book (no flaming please). The best advice i can give is to go to this page and go through the tutorial. It covers the majority of the C++ language (read: most commonly used features) and keeps it as simple as possible. As far as APIs that are important... well that is a matter of preference. No one toolkit/api has really "won", but Qt, GTK-- (gtkmm), and wxWidgets are all big players. And besides GUIs, you'll probably want to learn either the raw winsock2 and threading APIs OR the boost library's threading and network interfaces. I do agree that MFC is dying, and for windows-only development C# is taking an increasingly large role (even on linux/mono C# is starting to catch on... slowly).
Also, the best way to learn a language is to code. So don't just read a whole ton- without practical experience you're never going to learn the language. Ask questions, answer those you can, and write tutorials- for yourself if nobody else. Writing down what you've learned is a great reference, and the process of straightening everything out in your head to write it down in a fashion that another person can understand it alone is a great way to reinforce concepts. In a strange, but seemingly backwards, way I found the best way I learn programming is by helping other people with their questions.
#Neil- i disagree that online tutorials are "flat out wrong". If anything, the style they teach you might be geared towards readability rather than optimization- which in-my-not-so-humble-opinion is an advantage. In my limited experience I've found cplusplus.com a go-to reference for pretty much everything.
Specifically, to answer your questions:
1. No thick book needed. I've heard that the thinner ones can be useful as a quick reference, though.
It's completely subjective and depends on your goal. Boost's network and multithreading libraries are probably a good start.
between std::string, std::stringstream, and getline(std::istream&, std::string&) you should be pretty good. C++ comes with a whole ton of built-in functionality yet isn't too bloated/huge/impossible to learn. Take advantage of it. All of the parsing is built in already.
Please, for Pete's sake, don't use directly use the Win32 API. You'll be painting yourself in the Microsoft corner. There are plenty of cross-platform libraries out there you can use instead:
Standard C++ library: strings, file i/o, containers, algorithms
Boost for the everyday stuff they left out of the standard library: parsing, networking, threading, smart pointers, memory pools, date/time, matrices, etc... Boost libraries are peer-reviewed before being accepted and are high-quality. Boost is the breeding ground for libraries that eventually become part of the next C++ standard.
GUI Toolkits: Qt and wxWidgets are very mature and widely used. There are many more.
For C++ on windows, definitely learn Microsoft Foundation Classes (MFC). Without MFC, you have to implmenet all of the windows API stuff yourself, which is more C than C++ and can be quite a pain.
You also may want to get, learn, and use the boost C++ libraries. They aren't windows specific, but they are a great resource for anyone.
I highly recommend Stroustrup's Intro C++ book. It covers C++ and STL in a very approachable way.
After that you might consider looking into books on Qt, a multi-platform GUI toolkit, or WTL or MFC for Windows. You could do .NET + C++, but that would be a lot to learn. In my experience with Qt and MFC, books have not helped much. Tampering with sample apps, building small apps just to test out one kind of feature, and poking around the docs was the only way I could get my head around either library. The books I had tended to simply gloss over too much--they were not worth the money.

What's the C++ GUI building option with the easiest learning curve - VS/Qt/wxWidgets/etc.?

I'm looking to be able to build GUI applications quickly and painlessly as possible. I'm competent (though not expert, and have no formal training) in C++, but have never used a GUI building toolkit or framework or anything. I am not a professional programmer and am totally inexperienced and ignorant when it comes to building GUI apps. Have spent hours researching trying to figure out what to do; only getting more confused and discouraged though.
Qt and wxWidgets seem like the most popular options for cross-platform apps, though cross-platform isn't necessarily all that important to me; Windows-only is fine if that means the fastest learning curve.
Qt seems cool and the Qt Creator is sweet looking with lots of good demos, except it has its own classes for everything, and I'm not overly keen on learning a bunch of stuff that's only applicable to the Qt platform itself rather than more generally. I suppose I could avoid using the Qt classes except for the GUI stuff where I have to use them, but I have no idea how wise or unwise that would be.
I was thinking Visual Studio would have the smallest learning curve, but when I open a test GUI app, I see a bunch of foreign looking stuff like carats (^) all over the place - I found online that these mean "handles", which I have trouble even understanding the definition or purpose of ("sort of like pointers but not really" is basically how I've read people define them).
I know pretty much nothing about wxWidgets, or how it compares with Qt.
So every option has a big learning curve - and ideally I'd like to know which one minimizes the time you have to spend learning the toolkit/framework itself. Since I'm likely never going to be making money from the programs I create, the time I spend learning a specific toolkit would be pretty costly. I just want to be able to make a functional program using the C++ knowledge I have, but in GUI form. At the moment it seems if I want to make a GUI app, I'd have to spend way more time learning the GUI framework I'd use than writing the functional part of the app itself.
Any input from people wiser and more experienced than me would be appreciated :)
First and foremost, start simple. There's a lot to the subject. If you are finding it hard, don't try and take it in all at once.
Most of the good GUI packages have tutorials. The best advice I can give is that you try each of them, or at least a couple of them. They are the best short introduction you can have to the library you choose and if they are any good they narrow down what you need to absorb at first. That will give you some basis for comparison, because they are each trying to do very similar things (and you will see some of them before you are done), but they have different feels. You will likely find you have a preference for one and that's the one to get serious with. It will also give you a sense of what's hard about GUI programming as separate from the particulars of one package, which, if you have only used one, you won't have seen. Personally I find this sort of knowledge very helpful, because it makes me less intimidated by particulars.
Here's a list of tutorials in one place, though you have likely seen them already:
Qt's tutorial
WxWidgets' tutorial
Gtkmm book. Not quite a tutorial, though there are lots of examples.
.NET tutorials, either for WinForms or for WPF.
Second, it sounds to me that you need to get some in depth understanding of the concepts of GUI programming, not just a particular library. Here there is no substitute for a book. I don't know all of them by a long shot, but the best of the bunch will not just teach you the details of a toolkit, they will teach you general concepts and how to use them. Here are some lists to start with though (and once you have titles, Amazon and Stack Overflow will help to pick one):
List of Qt books
WxWidgets book (PDF version)
There are tons of WPF and WinForms books. I can't make a good recommendation here unfortunately.
Third, take advantage of the design tools (Qt Creator, VS's form building and so on). Don't start by trying to read through all the code they generate: get your own small programs running first. Otherwise it's too hard to know what matters for a basic program and what doesn't. The details get lost. Once you've got the basics down though, Do use them as references to learn how to do specific effects. If you can get something to work in the design tools, then you can look at particular code they generate to be able to try on your own hand-written programs. They are very useful for intermediate learning.
I'm not overly keen on learning a bunch of stuff that's only applicable to the Qt platform itself rather than more generally.
I second the comment of GRB here: Don't worry about this. You are going to need to learn a lot specific to the toolkit no matter which toolkit you use. But you will also learn a lot that's general to GUI programming with any of the decent toolkits, because they are going to have to cover a lot of the same ground. Layouts, events, interaction between widgets/controls, understanding timers -- these will come up in any GUI toolkit you use.
However do be aware that any serious GUI package is an investment of time. You will have a much easier time learning a second package if you decide to pick one up, but every large library has its personality and much of your time will be spent learning its quirks. That is, I think, a given in dealing with any complex subject.
I suppose I could avoid using the Qt classes except for the GUI stuff where I have to use them, but I have no idea how wise or unwise that would be.
You do not need most of the non-GUI classes of Qt to use Qt's GUI properly. There are a handful of exceptions (like QVariant) which you'll need just because the GUI classes use them. I found you can learn those on a case-by-case basis.
Which is the easiest to learn is really going to depend on how you personally learn.
Personally, I've found Qt to be the easiest to learn so far. The GUI classes are rather nice to use, but I've found the non-GUI classes to be excellent, making it easy to avoid a lot of common issues you'd normally get with a more basic API. The documentation is excellent, IMO, as are the books, the examples, etc. It's also being very actively developed, with a few new technologies coming in the near future (like DeclarativeUI).
I've found Visual Studio/Windows API/.Net to be a good bit more complicated to learn. The API documentation on MSDN is rather complicated and not really organized in a manner that I find intuitive.
I've tried learning WxWidgets a few times, but I've never liked the API documentation.
All this is just my personal experience, YMMV of course. I'd say just dabble in all of them and see which one takes you the furthest, it won't hurt to try multiple.
As a person who learned C++ through Qt, I can only say that they work very well together. C++ purists (like I have become) will find lots of things in Qt not to their liking (the moc preprocessor, e.g., and the continued absence of exceptions for error reporting), but looking back, Qt provided a very gentle introduction to C++ for me.
And if you're like me, you throw in a handful of boost libs in each Qt project, because we want to write "real" C++, not the softened thing Qt uses :)
I would suggest wxWidgets. To me, it's pretty intuitive and looks nice.
Code::Blocks was built with it, so check that out to see if you like the graphics.
There are also a slew of bindings for wxWidgets, such as wxPython, wxErlang, and others, so if you decide to switch off of C++, you can take wxWidgets with you.
I also use wxWidgets and use it all the time for Windows-only applications (the only downside is that wxWidgets is notorious for large .exe filesizes, which may or may not be a problem for you). I found it very simple to use from the start, especially when combined with a GUI designer (personally I use wxDev-C++).
I've never used Qt, so I can't speak to its simplicity, but I doubt the difficulty is on a vastly different scale than that of wxWidgets. However, what I can say is that no matter what API you use (wxWidgets, Qt, WinAPI, etc) your code will be "locked into" that particular platform, so don't worry if you feel that learning Qt will lock you into the Qt platform (because the same thing will happen with any of those APIs).
If you're working solely on Windows however, you may want to do a few simple programs with WinAPI first. That way you have a basic understanding of the lowest level of Windows GUI programming before you move onto Qt/wxWidgets. That said, if you're really into cross-platform programming, then don't worry about that and go straight into Qt/wxWidgets.
I can't intelligently comment on the learning curve aspect, but a quick survey of StackOverflow questions shows about twice as many Visual C++ questions as Qt questions. Probably means that there is a larger support group in place for Visual C++. Might make learning it a little easier if there are more folks to help out.
No matter what you pick, I am quite sure it won't be easy and painless.
Having said that, I know that in some schools they use FLTK because they consider it relativelly easy to learn. I have never tried it.
In my everyday work I use WTL which is as close to the system as it gets while still providing some level of abstraction over pure Win32. I am not sure if I would consider it easy to learn, though, especially given the lack of documentation.
I recommend codegear C++ builder (previously known as borland C++ builder) from codegear which comes with a 30 trial. The nicest thing about it is that the GUI provides you with components that you drop onto a form in a WYSIWYG fashion and make functional by adding code to handle the events it fires. It comes with a whole bunch of compontents out of the box and you can add 3rd party components to it too, like the awesome ExpressQuantumGrid from devexpress, or write your own. It's very powerfull if you know what you're doing but intuitive enough that a beginner can write a database CRUD application in about 20 lines of very simple code.
Since nobody has mentioned it yet, for the sake of completeness, have a plug for the Fox toolkit. This is the one I used last time I did any C++ UI work of my own volition. There are also binding for this to Ruby and Python (the latter being many years out of date, though).
In general, the choice of a toolkit for self-directed work comes down to personal preferences for
the layout manager style
the event handler registration style
How native the widget set looks/can be made to look
If cross-platforming is not necessary, try .net + msvs or delphi. easy, all-in-one, no pain.
Qt is the best option for you. It's the easiest to learn, the most elegant and powerful and it is completely free.
Visual C++: This is an IDE, but it comes with its own GUI library called MFC. MFC is an old library with many quirks and it is difficult to learn and use. Many C++ programmers use it on Windows because it comes from MS, it's fast and it's free if you buy Visual C++. Since VC++ is an IDE, you can also use wxWidgets and Qt with it, although in your particular case I would recommend Qt Creator instead.
You seem to have experimented with Managed C++. Don't use that, even MS recommends that you only use Managed C++ as glue between C++ and C#.
wxWidgets: This one was a strong contender up to the day when Qt became free for commercial projects. It was always in the shadow of Qt and it is known that the documentation is not very good and the API is not as easy to learn as Qt's. Cross-platform MFC would be a good way to describe it.
C++ Builder: Borland made too many mistakes with C++ Builder and ended up getting out of the dev tools business altogether. It was a good product and I originally learned Windows GUI programming in one of the first versions, but I won't use it any more. There are better options and it is too expensive.