int CVcccommDlg::OnCreate(LPCREATESTRUCT lpCreateStruct)
{
if(CDialog::OnCreate(lpCreateStruct)== -1)
return -1;
}error C2601: 'OnCreate' : local function definitions are illegal
Error executing cl.exe.哪位大侠告诉我这是什么原因啊?
谢谢了!
{
if(CDialog::OnCreate(lpCreateStruct)== -1)
return -1;
}error C2601: 'OnCreate' : local function definitions are illegal
Error executing cl.exe.哪位大侠告诉我这是什么原因啊?
谢谢了!
解决方案 »
- CString("1") + "2" 会报一个"传递给系统调用的数据区域太小"是神马情况?
- QueueUserWorkItem添加多个执行函数,似乎不行啊
- 请问怎么在程序中改变windows任务栏(taskbar)的位置(例如放在右边)和大小?
- 为什么用PostMessage 程序就死掉?
- 关于视频每行所占字节数的疑问
- ***********收费系统网络问题*************
- 为什么我的控件注册不了?
- 关于CList<Bitmap*, Bitmap*&>
- 再再次请教:如何获得当前所有进程的CPU使用率和内存占用情况?
- 关于CListCtrl的问题`
- 如果恢复显示最小化在托盘的程序
- 怎样保存动态数据到Excel文件(在线等)
afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);int CVcccommDlg::OnCreate(LPCREATESTRUCT lpCreateStruct)
{
if (CDialog::OnCreate(lpCreateStruct) == -1)
return -1;
return 1;
}
4楼的方法好像不对,编译完后出现下面的错误:D:\Program Files\visual c++\MSDev98\MyProjects\vcccomm\vcccommDlg.cpp(135) : error C2601: 'OnCreate' : local function definitions are illegal
D:\Program Files\visual c++\MSDev98\MyProjects\vcccomm\vcccommDlg.cpp(135) : fatal error C1903: unable to recover from previous error(s); stopping compilation
Error executing cl.exe.
{
CDialog::OnInitDialog();
// 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
int CVcccommDlg::OnCreate(LPCREATESTRUCT lpCreateStruct)
{
if (CDialog::OnCreate(lpCreateStruct) == -1)
return -1;
return 0; //缺少这一行?
}
DWORD style=WS_VISIBLE|WS_CHILD;
if(!myComm.Create(NULL,style,CRect(0,0,0,0),this,IDC_MSCOMM1))
{
AfxMessageBox("创建MSComm控件失败!");
return -1;
}
return TRUE; // return TRUE unless you set the focus to a control
}这个是{}里面全部的代码,看看在哪个地方出现了问题?
我把它放在{}外面后,出现error C2509: 'OnCreate' : member function not declared in 'CVcccommDlg'
的错误.
建议好好看看书!
在CVcccommDlg class里加 afx_msg int OnCreate(LPCREATESTRUCT pcs);