ok MFC is all about classes hierarchy, inheritance ... and so is some other good API like Qt.
most of the time you will be deriving your own classes from the API classes heres an short example:
since you are using the VC studio
heres a example of a MFC app.
New Project -> Win32 Project -> name it -> at the wizard go to the application setting check the empty project box.
Now you you have an empty project yay so go the Project menu then -> properties -> Configuration properties -> General -> Use of MFC choose: Use MFC in a Shared DLL -> click the Ok button.
now Add -> Add New Item -> code -> source code -> name it.
add the following code.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30
|
#include <afxwin.h>
class COurapp : public CWinApp
{
public:
virtual BOOL InitInstance();
};
class COurWnd : public CFrameWnd
{
public:
COurWnd()
{
Create(0, L"WOW a Window");
}
};
BOOL COurapp::InitInstance()
{
m_pMainWnd = new COurWnd;
m_pMainWnd->ShowWindow(m_nCmdShow);
return TRUE;
}
COurapp AnApp;
|
a nice starting book:
Ivor Horton’s
Beginning Visual C++® 2005
its a book from 2006(i think)
the MFC changed a little since.
any book from Jeffrey M. Richter or Charles Petzold on windows programming
is highly recommended.
MFC documentation can be found here:
if you did not install the msdn you can find it online here:
http://msdn.microsoft.com/
Dont worry you can use the VC Studio GUI designer with the MFC too.
Create a Project with the MFC application template you have a simple program in less than 5 minutes.
[EDIT]
if your did not like the MFC or wanna check other APIs a nice API list can be found here (thanks Duoas):
http://www.free-soft.org/guitool/
Jeff