替换对话框问题

来源:百度知道 编辑:UC知道 时间:2024/06/23 03:01:13
在头文件夹里添加
afx_msg long OnFindReplace(WPARAM wParam,LPARAM lParam);
在对话框消息映射部分添加映射宏
ON_REGISTERED_MESSAGE(WM_FINDMESSAGE, OnFindReplace )
添加函数
void CAaaDlg::OnOK()
{
CFindReplaceDialog *m_finddlg = new CFindReplaceDialog();
m_finddlg->Create(FALSE,NULL);
m_finddlg->ShowWindow(SW_SHOW);
}
错误
error C2065: 'WM_FINDMESSAGE' : undeclared identifier
执行 cl.exe 时出错.
请帮忙
我加了
后面出现x_tidaiDlg.cpp
D:\VC98\MSDev98\MyProjects\Ex_tidai\Ex_tidaiDlg.cpp(88) : error C2101: '&' on constant
执行 cl.exe 时出错.
这是什么意思,怎么解决?

在对话框消息映射部分之前添加
AFX_STATIC const UINT WM_FINDMESSAGE = ::RegisterWindowMessage(FINDMSGSTRING);

在那函数里 CFindReplaceDialog 不要动态建立,那个指针没有释放.

用 DoModel 试试

WM_FINDMESSAGE没有定义
你可以在篇头添加
define WM_FINDMESSAGE WM_USER+100