华为荣耀3c关机刷机:VC++高手进

来源:百度文库 编辑:查人人中国名人网 时间:2024/05/09 06:01:30
BEGIN_MESSAGE_MAP(CAboutDlg, CDialog)
//{{AFX_MSG_MAP(CAboutDlg)
// No message handlers
//}}AFX_MSG_MAP
ON_MESSAGE(WM_COUNT_MSG, OnCountMsg)
END_MESSAGE_MAP()

error C2065: 'OnCountMsg' : undeclared identifier
error C2440: 'type cast' : cannot convert from 'int *' to 'long (__thiscall CWnd::*)(unsigned int,long)'

不知道哪错了。。。
OnCountMsg函数有的:
LRESULT CMsg2Dlg::OnCountMsg(WPARAM wParam, LPARAM lParam)
{
this->SetDlgItemInt(IDC_PROMPT, lParam);
return 1;
}
是不是这个函数的问题?

你把
ON_MESSAGE(WM_COUNT_MSG, OnCountMsg)
加错地方了,你加到AboutDlg类里去了。

要加到CMsg2Dlg类里!
你找找这个地方加进去。
BEGIN_MESSAGE_MAP(CMsg2Dlg, CDialog)
//{{AFX_MSG_MAP(CMsg2Dlg)
// No message handlers
//}}AFX_MSG_MAP
ON_MESSAGE(WM_COUNT_MSG, OnCountMsg)
END_MESSAGE_MAP()

有OnCountMsg函数么?仔细查查吧,总之要相信VC是不会冤枉你的,一定是你自己的错,好好向VC检讨下吧。