VisualC++6.0问题CFrameWnd是基类,派生类CMainFrame的参数UINT nFlags,CPoint point传递给基类有什么用
#include<afxwin.h>classCHelloApp:publicCWinApp{public:virtualBOOLInitInstance();};CHe...
#include <afxwin.h>
class CHelloApp:public CWinApp
{public:virtual BOOL InitInstance(); };
CHelloApp theApp;
class CMainFrame:public CFrameWnd
{public:CMainFrame()
{ Create(NULL,"我的窗口",WS_OVERLAPPEDWINDOW,CRect(0,0,400,300));}
protected:
afx_msg void OnLButtonDown(UINT nFlags,CPoint point);
DECLARE_MESSAGE_MAP()
};
BEGIN_MESSAGE_MAP(CMainFrame,CFrameWnd)
ON_WM_LBUTTONDOWN()
END_MESSAGE_MAP()
void CMainFrame::OnLButtonDown(UINT nFlags,CPoint point)
{MessageBox("你好,我的Visual C++世界!","问候",0);
CFrameWnd::OnLButtonDown(nFlags,point); //CFrameWnd是基类,派生类CMainFrame的参数
//(UINT nFlags,CPoint point)
//传递给基类有什么用
}
BOOL CHelloApp::InitInstance()
{m_pMainWnd=new CMainFrame();
m_pMainWnd->ShowWindow(m_nCmdShow);
m_pMainWnd->UpdateWindow();
return TRUE;} 展开
class CHelloApp:public CWinApp
{public:virtual BOOL InitInstance(); };
CHelloApp theApp;
class CMainFrame:public CFrameWnd
{public:CMainFrame()
{ Create(NULL,"我的窗口",WS_OVERLAPPEDWINDOW,CRect(0,0,400,300));}
protected:
afx_msg void OnLButtonDown(UINT nFlags,CPoint point);
DECLARE_MESSAGE_MAP()
};
BEGIN_MESSAGE_MAP(CMainFrame,CFrameWnd)
ON_WM_LBUTTONDOWN()
END_MESSAGE_MAP()
void CMainFrame::OnLButtonDown(UINT nFlags,CPoint point)
{MessageBox("你好,我的Visual C++世界!","问候",0);
CFrameWnd::OnLButtonDown(nFlags,point); //CFrameWnd是基类,派生类CMainFrame的参数
//(UINT nFlags,CPoint point)
//传递给基类有什么用
}
BOOL CHelloApp::InitInstance()
{m_pMainWnd=new CMainFrame();
m_pMainWnd->ShowWindow(m_nCmdShow);
m_pMainWnd->UpdateWindow();
return TRUE;} 展开
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询