求助,求VC++6.0大神指导
为什么在VC++6.0中用MFC创建windows窗口程序编译通过,打开EXE文件却没反应??? 程序如下:
#include"afxwin.h" //MFC程序库
class CMinMFCApp:public CWinApp //窗口类
{
public:
virtual BOOL Initlnstance();
};
class CMainWnd:public CFrameWnd
{
protected:
afx_msg void OnLButtonDown(UINT nFlags,CPoint point);
afx_msg void OnRButtonDown(UINT nFlags,CPoint point);
DECLARE_MESSAGE_MAP();
};
BEGIN_MESSAGE_MAP(CMainWnd,CFrameWnd)
ON_WM_LBUTTONDOWN()
ON_WM_RBUTTONDOWN()
END_MESSAGE_MAP()
void CMainWnd::OnLButtonDown(UINT nFlags,CPoint point)
{
CString szAboutLeft=" 这是一个最小的WindowsMFC程序.\n你按下了鼠标左键!";
::MessageBeep(MB_ICONINFORMATION);
::MessageBox(GetSafeHwnd(),szAboutLeft,"About",MB_OK|MB_ICONINFORMATION);
CFrameWnd::OnLButtonDown(nFlags,point);
}
void CMainWnd::OnRButtonDown(UINT nFlags,CPoint point)
{
CString szAboutRight=" 这是一个最小的WindowsMFC程序.\n你按下了鼠标右键!";
::MessageBeep(MB_ICONINFORMATION);
::MessageBox(GetSafeHwnd(),szAboutRight,"About",MB_OK|MB_ICONINFORMATION);
CFrameWnd::OnRButtonDown(nFlags,point);
}
BOOL CMinMFCApp::Initlnstance()
{
CMainWnd*pFrame = new CMainWnd;
pFrame->Create(0,_T("另一个小MFC程序"));
pFrame->ShowWindow(SW_SHOWMAXIMIZED);
pFrame->UpdateWindow();
AfxGetApp()->m_pMainWnd=pFrame;
return TRUE;
}
CMinMFCApp MyApp;
是哪里出问题了 ?