D:\Cao\MyButton\MyButtonDlg.cpp(95) : error C2065: 'MyButton' : undeclared ident

编程小白_大场 2012-11-29 10:33:45
#include "stdafx.h"
#include "MyButton.h"
#include "MyButtonDlg.h"

#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif



BOOL CMyButtonDlg::OnInitDialog()
{
CDialog::OnInitDialog();

MyButton *myButton=new MyButton();
// Add "About..." menu item to system menu.

// IDM_ABOUTBOX must be in the system command range.
ASSERT((IDM_ABOUTBOX & 0xFFF0) == IDM_ABOUTBOX);
ASSERT(IDM_ABOUTBOX < 0xF000);

CMenu* pSysMenu = GetSystemMenu(FALSE);
if (pSysMenu != NULL)
{
CString strAboutMenu;
strAboutMenu.LoadString(IDS_ABOUTBOX);
if (!strAboutMenu.IsEmpty())
{
pSysMenu->AppendMenu(MF_SEPARATOR);
pSysMenu->AppendMenu(MF_STRING, IDM_ABOUTBOX, strAboutMenu);
}
}

// Set the icon for this dialog. The framework does this automatically
// when the application's main window is not a dialog
SetIcon(m_hIcon, TRUE); // Set big icon
SetIcon(m_hIcon, FALSE); // Set small icon

// TODO: Add extra initialization here

return TRUE; // return TRUE unless you set the focus to a control
}


D:\Cao\MyButton\MyButtonDlg.cpp(95) : error C2065: 'MyButton' : undeclared identifier


D:\Cao\MyButton\MyButtonDlg.cpp(99) : error C2143: syntax error : missing ';' before '{'

...全文
239 2 打赏 收藏 转发到动态 举报
写回复
用AI写文章
2 条回复
切换为时间正序
请发表友善的回复…
发表回复
lilianjie001 2012-11-29
  • 打赏
  • 举报
回复
应该为CMyButton 吧
appleyk 2012-11-29
  • 打赏
  • 举报
回复
MyButton.h 文件中 类定义的结尾是不是少了个分号?

33,311

社区成员

发帖
与我相关
我的任务
社区描述
C/C++ 新手乐园
社区管理员
  • 新手乐园社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧