19,468
社区成员
发帖
与我相关
我的任务
分享
//接受自定义消息类头文件定义,比如**view.h
#define WM_WORKFACE_SELECTED WM_USER+1
#define WM_SECTIONFACE_SELECTED WM_USER+2
class C**********OLPSView : public CView
{
// ............
afx_msg LRESULT OnVPOutterSet(WPARAM,LPARAM);
afx_msg LRESULT OnVPSectionSet(WPARAM,LPARAM);
}
//cpp文件
BEGIN_MESSAGE_MAP(CGCSprayingOLPSView, CView)
//{{AFX_MSG_MAP(CGCSprayingOLPSView)
// NOTE - the ClassWizard will add and remove mapping macros here.
// DO NOT EDIT what you see in these blocks of generated code!
//}}AFX_MSG_MAP
ON_MESSAGE(WM_WORKFACE_SELECTED,OnVPOutterSet)
ON_MESSAGE(WM_SECTIONFACE_SELECTED,OnVPSectionSet)
END_MESSAGE_MAP()
LRESULT C******OLPSView::OnVPOutterSet(WPARAM w,LPARAM l)
{
//TODO:ADD HERE
}
LRESULT C******OLPSView::OnVPSectionSet(WPARAM w,LPARAM l)
{
//TODO:ADD HERE
}
//在你的OnComm事件处理函数中发送消息
::PostMessage(m_hWnd,WM_USER+1,planeid,0); //后两个参数对应WPARAM w,LPARAM l