以前对于MFC的了解十分肤浅,只知道MFC = Microsoft Foundation Class,后来还道听途说了很多关于她的风流韵事。有人说她如维纳斯一般美丽,也有人说她和犹大一般丑恶。现在为了手头上的事情,我要从新认识这位也许风华不在的女子了,不管她长得如何,我都得去揭开她那对于我来说神秘的面纱。
还是从打招呼开始吧,以免把她吓着了。于是,我战战兢兢的跟MFC say hello了。
| MyApp.h: class CMyApp : public CWinApp { public: virtual BOOL InitInstance(); }; // frame window class class CMyFrame : public CFrameWnd { public: CMyFrame(); protected: // "afx_msg" indicates that the function is part // of the MFC library message dispatch system afx_msg void OnPaint(); DECLARE_MESSAGE_MAP() }; MyApp.cpp: #include <afxwin.h> // MFC library header file declares base classes #include "myapp.h" CMyApp theApp; // the one and only CMyApp object BOOL CMyApp::InitInstance() { m_pMainWnd = new CMyFrame(); m_pMainWnd->ShowWindow(m_nCmdShow); m_pMainWnd->UpdateWindow(); return TRUE; } BEGIN_MESSAGE_MAP(CMyFrame, CFrameWnd) ON_WM_PAINT() END_MESSAGE_MAP() CMyFrame::CMyFrame() { Create(NULL, "MYAPP Application"); } void CMyFrame::OnPaint() { CPaintDC dc(this); dc.TextOut(0, 0, "Hello, MFC!"); } |
相关图文阅读
频道图文推荐
健 康 咨 询
时 尚 咨 询
相关专题
- Solaris基础知识入门 (4590篇文章)
- Google在线翻译--请输入要翻译的内容 (59859次浏览)
- VC++动态链接库(DLL)编程深入浅出(二) (15435次浏览)
- VC++动态链接库(DLL)编程深入浅出(一) (13930次浏览)
- 基于OpenGL的三维曲面数据场动态显示 (607次浏览)
- 深入浅出Win32多线程设计之MFC的多线程 (531次浏览)
- 利用钩子技术控制进程创建(附源代码) (530次浏览)
- Visual C++初学者入门的一条捷径 (365次浏览)
- RS-232-C端口实时监控软件的设计实现 (326次浏览)
- Windows Gdi 应用-入门篇 (VC SDK) (317次浏览)
- Windows多线程多任务设计初步 (313次浏览)



