|
-
Mar 4th, 2002, 11:31 PM
#1
Thread Starter
Fanatic Member
simple MFC app
could someone post the most basic barebones MFC app possible? i don't have any books that explain MFC and i don't wanna buy any. Besides i already understand a little bit of MFC and i understand C++ syntax, im just not sure where to begin a program with MFC
thanks
The human brain cannot hold all of the knowledge that exists in this world, but it can hold pointers to that knowledge.
-
Mar 5th, 2002, 08:12 AM
#2
This is the most basic MFC app that I can somehow think of.
It just creates a window, it doesn't even draw it.
Code:
#include <afxwin.h>
class CMainFrame : public CWnd
{
public:
CMainFrame();
};
CMainFrame::CMainFrame()
{
LPCTSTR szClass = AfxRegisterWndClass(0);
CreateEx(0, szClass, "Basic MFC app", WS_OVERLAPPEDWINDOW,
CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, NULL, NULL);
}
class CBasicMFCApp : public CWinApp
{
public:
virtual BOOL InitInstance();
};
CBasicMFCApp theApp;
BOOL CBasicMFCApp::InitInstance()
{
CWnd* pFrame = new CMainFrame;
m_pMainWnd = pFrame;
pFrame->ShowWindow(SW_SHOW);
pFrame->UpdateWindow();
return TRUE;
}
All the buzzt
 CornedBee
"Writing specifications is like writing a novel. Writing code is like writing poetry."
- Anonymous, published by Raymond Chen
Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|