D
d村长
Unregistered / Unconfirmed
GUEST, unregistred user!
#include <afxwin.h>
#include "resource1.h"
class CmyApp : public CWinApp
{
public:
virtual BOOL InitInstance();
};
BOOL CmyApp::InitInstance ()
{
m_pMainWnd=new CmyFrame();
m_pMainWnd->ShowWindow (m_nCmdShow);
m_pMainWnd->UpdateWindow ();
return TRUE;
}
CmyFrame::CmyFrame(void)
{
Create(NULL, "Hello MFC", WS_OVERLAPPEDWINDOW, rectDefault,NULL,"IDR_MENU1");
button=new CButton();
button->Create ("按钮",WS_CHILD|WS_VISIBLE|BS_PUSHBUTTON, CRect(10,10,100,30), this, 100);
}
CmyApp theapp;
class CmyFrame ublic CFrameWnd
{
public:
CButton *button;
CmyFrame();
};
在VC++7中如果在CREATE 中不加入菜单就可以正常编译执行,但如果加上菜单以后,就出错~~请高手指点~~
#include "resource1.h"
class CmyApp : public CWinApp
{
public:
virtual BOOL InitInstance();
};
BOOL CmyApp::InitInstance ()
{
m_pMainWnd=new CmyFrame();
m_pMainWnd->ShowWindow (m_nCmdShow);
m_pMainWnd->UpdateWindow ();
return TRUE;
}
CmyFrame::CmyFrame(void)
{
Create(NULL, "Hello MFC", WS_OVERLAPPEDWINDOW, rectDefault,NULL,"IDR_MENU1");
button=new CButton();
button->Create ("按钮",WS_CHILD|WS_VISIBLE|BS_PUSHBUTTON, CRect(10,10,100,30), this, 100);
}
CmyApp theapp;
class CmyFrame ublic CFrameWnd
{
public:
CButton *button;
CmyFrame();
};
在VC++7中如果在CREATE 中不加入菜单就可以正常编译执行,但如果加上菜单以后,就出错~~请高手指点~~