MFC resources / links - c++

I am about to reenter the MFC world after years away for a new job. What resources to people recommend for refreshing the memory? I have been doing mainly C# recently.
Also any MFC centric websites or blogs that people recommend?

The best: The Code Project

For blogs: Your best bet would be the Visual C++ Team Blog.
For books: Programming Windows with MFC is one of the best book on the subject.
For tutorials: Simply search google for various tutorials on MFC.

There's lots of useful information here:
http://www.flounder.com/mvp_tips.htm

I would highly recommend my all-time favorite book: MFC Internals: Inside the Microsoft© Foundation Class Architecture
It is not a 'how-to' book — it is a 'how does it work' book.

Its been a long time since i did any MFC but back then it used to be
"MFC internals" + debug into the MFC code and find what happens which used to be the best resources on MFC
Samples used to be available from Code Project to quickly get you going.

The vital "how do I?" book is http://www.amazon.com/gp/reader/0201185377/ref=sib_dp_pt#reader-link
Codeproject is also invaluable, although many of the 3rd party controls there nowhave counterparts in the new MFC feature pack.

Books are one thing, but I always found that practice was the key with MFC. CodeGuru was my favourite destination to answer anything MFC-related.
There's also that new website. What's it called...that's it - StackOverflow!

Related

Creating GUIs in Win32 C++

I'm developing my first Windows desktop application and I'm trying to figure out what the best approach would be to create the program's GUI.
I know, I know... I feel stupid for asking considering the amount of data on the subject on SO. However most answers seem outdated and I'm not sure if they fit my specific project. Also tutorials for Windows 8 'metro apps' are clogging my Google search results, which is NOT what I'm looking for.
I use Visual Studio. I've followed tutorials. I have basic knowledge of C and Java and extensive experience with PHP. I'm excited to learn C++, so I'm not looking for GUIs to create a GUI (like WinForms). I also don't care about managed code and portability for now, especially since I'm trying to avoid dependencies (i.e. users having to install .NET). As long as it runs smoothly on Vista and up, I'm happy.
The application
The software will teach basic physics to kids. I'd like to create a main area and a sidebar. The main area will feature a physics animation, say a bouncing ball, along with some Q&A. Users can zoom in to the animation to measure some stuff and answer the question. Users can track their progress in the sidebar. That's pretty much it.
What I've found so far
I'm getting a bit frustrated with MSDN. Most of their examples are given in four different languages (C#, C++, etc). I can't seem to get more than a bit of Hello World code from them.
I found a GDI API on MSDN and it seems like a good start for me. However I've read quite a few answers on SO saying creating layouts in pure C++ is really hard, that we're better of using frameworks like ATL and WTL. Since I'm also going to create (somewhat interactive) animations, I've wondered whether I should use gaming-targeted APIs like Direct2D.
Since all of this is new to me, and there are a lot of options, I don't know where to start for my particular application. Any tips would be greatly appreciated!
Using the raw Win32 API (no additional downloads or third-party helpers):
Here's a good primer (introduces dialog boxes, text boxes, buttons, etc): theForger's Win32 API Tutorial
And here's where you go from there (numeric up-downs, list boxes, combo boxes, tooltips, and more): Common Controls on MSDN. Most of these require you to #include <commctrl.h>.
I also found this to be a good resource that covered what the other two didn't: Win32 Developer - Window Assets
But the Win32 API doesn't seem like it does exactly what you want. A physics app for kids should have a more visual GUI than the API can provide. Good luck, though!
If you're ok with adding additional Frameworks, I'd suggest looking at Qt.
It allows to create the GUI from code only, has a good structure, and has an Interface for 2D drawing, if required.
If you are concerned about dependencies, you only have to include the Qt DLLs to your executables; no installation is required for the user.
To get started, see my (old) tutorial "Lessons in Windows API Programming".
But you really need a good book, such as edition 5 or earlier of Charles Petzold's classic "Programming Windows".
The problem with latest edition is that it's for C# and .NET, with Charles grabbing the tail of the "new way" at just the wrong time…
Disclaimer: I haven't checked the details of edition numbers.
Using the Windows API is the simplest, but producing advanced GUIs can take a very long time. Microsoft Foundation Class is a way to make the Windows API more user friendly and OOP. Does anyone have any experience with MFC?
Why not use some 2D C++ game engine, like HGE: http://hge.relishgames.com/overview.html.

Anyone know of a book or documentation like MFC Internals for Qt?

I have recently read MFC Internals (ISBN 9780201407211) and it helped me greatly gain an intimate understanding of how MFC works and increased productivity about 100 fold. I was wondering now that I am into Qt, is there any book or documentation out there like this? I have been having a hard time finding straight-up documentation on Qt, it always seems to be beat-around=the-bush style of documentation (they tell you how to build the house, but not how to cut down the tree) ??
The best way is to try developing your own application. Just start from a basic application like calculator. Add a few widgets to it and code it as you go. For reference use "C++ gui programming with Qt4" mentioned by Zlatomir. I have recently designed a whole GUI using Qt. I drew its screenshots on Inkscape to get a prototype look and afterwards I started working on designer to fulfill each functionality. Then I implemented the code and I repeated the designing and coding steps. Also, the best help will be Qt Assistant - its sufficiently complete, no Internet required so save times and simple to use. Going my way, you will not only learn Qt in short interval after which you can go through the book to know what tips and tricks you might not know, but also it will be interesting so that you may not give up like many others who just fall midway through the reading part. Warning - Doing this way, you will also know about pitfalls/drawbacks of Qt and how to not go that way.
This is one of the links I found last night. I went through 2 pages and found it might make your life a bit easier - http://zetcode.com/gui/qt4/
I have not read the MFC book you mentioned, but the Qt framework i learned by reading from "C++ gui programming with Qt4" (the first edition is available as a free download) and "Foundation of Qt development" and also it's worth mentioning this documentation page, that contains links to the basic concepts of Qt framework.

i want to study win32 programming

i want to study win32 programming(windows form applications) please advise me good sites or good book (language c++)
Window form applications generally refers to .NET (C#, VB.NET, etc). However, if you want to do win32 windows applications, this is a solid introduction, which I used when learning:
http://www.charlespetzold.com/pw5/
Edit:
Now that I think about it, I also learned Win32 from this source, which is free, and available online:
http://www.relisoft.com/book/
This is the guy we all learned C++ from:
http://www2.research.att.com/~bs/
I'm a new user here, so I can't post another link, but look at his FAQ for ideas on how to learn C++.
C Only
http://www.winprog.org/tutorial/
http://www.functionx.com/win32/index.htm
http://zetcode.com/tutorials/winapi/
C and C++
http://www.tenouk.com/abouttenouk.html

GUI Framework/Lib for C++ under Windows [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 7 years ago.
Improve this question
I was wondering is there an Microsoft alternative to MFC, except WinForms in GUI programming for Windows operating system ?
I dont want to use thirdparty (Borland/Qt/wxWindows) libraries. WinForms require .NET which is major problem (can't install .NET in destination machines) and MFC is traumatic to me...
Any alternative which would be close to Qt but Microsoft branded ?
I would appreciate any suggestions!
I too suggest WTL. Here is a list with some useful WTL links:
MSDN's ATL 3.0 Window Classes: An Introduction - for the basics.
WTL Articles by Chris Sells, Dharma Shukla, and Nenad Stefanovic part1 and part2. Nenad Stefanovic is the father of WTL.
Bjarke Viksoe's WTL projects. Bjarne has summed many of his small projects into a whole application, an IDE - BVRDE.
Code Project's WTL page. Watch out especially the articles written by Michael Dunn. VMware Workstation uses WTL and Michael Dunn works for VMware.
Clipcode's WTL Developer’s Guide (doc, pdf, source code).
WTL opensource applications, which one can study to see various implementation tricks:
Google's Chromium, source code here. The windows version uses WTL. I don't know if somebody has tried to extract the WTL framework from Chromium.
Programmer's Notepad uses WTL, source code here.
InfraRecorder uses WTL, source code here.
Try WTL. This library was originally created by Microsoft and then went open source. On the contrary with MFC, many developers report good experiences with it. It builds lighter executables, it is better structured than MFC, but also not so feature rich.
I don't think there's any. You can use pure WinAPI, ATL, WTL (in this case good luck!).
Why don't you want to use Qt? Its free, open source and very flexible tool.
Although I love it and have used it extensively, WTL is quite an effort to learn as the documentation isn't great. There are some great 'WTL for MFC Programmers' articles on Code Project which are an absolute must-read.
However, if you want something Qt-like from MS, then you're only left with MFC I'm afraid. OK, it's long in the tooth but with the addition of the VS2008 SP1 MFC Feature Pack you can create Office 2007-like apps complete with ribbons. This might be your best solution if only MS non-.NET tech is allowed.
There is not any. Do not waste your time for searching.
Any alternative which would be close to Qt but Microsoft branded
If by "close to Qt" you mean similar in design to Qt, then no - there is not. I use WTL and like it, but it is very different from Qt.
You could always go with the Windows API directly and bypass MFC.
I don't get it. If it isn't Win32 or MFC or Windows.Forms, then what you are looking for is by definition 3rd party.
All these people recommending WTL are recommending you download some third party project's toolkit and use it. That's fine, if that's what you are looking for. But if you do that, then I strongly suggest looking at Qt or wxWidget. The former for the most full-featured set you can get and the latter for drawing native widgets using a "more sane" API.
Aside: WTL may be downloadable from MS server, but its a far, far cry from a MS-supported technology. It is an unsupported add-on.

What are the most active community resources for MFC development?

I am wondering what are the best community resources for MFC development- such as forums, IRC channels, etc. Currently the only resource I have for finding answered questions on MFC is using google which comes up with Codeproject results or the occasional result on MSDN or some other web page. Now that there is stackoverflow I am sure I will be asking more questions here, but else am I missing?
MVP Tips is a treasure trove of articles and information that relate to visual c++ and MFC. There's not much out there beyond codeplex and the Microsoft news groups/forums
You should also look at the microsoft.public.vc.mfc and microsoft.public.vc.language newsgroups, and the Visual C++ General and Visual C++ Language forums on MSDN, where there are some highly knowledgeable and helpful people. (It's a shame the MSDN forums aren't better designed - they should take a close look at StackOverflow.)
codeproject is my favorite web site
There is also an excellent book
irc #winprog on efnet