MFC中sendmessage问题 10
Jog.cppBEGIN_MESSAGE_MAP(CJog,CDialog)ON_MESSAGE(WM_JOG_DATA_ARRIVE,OnDataArrivedMsg1...
Jog.cpp
BEGIN_MESSAGE_MAP(CJog, CDialog)
ON_MESSAGE(WM_JOG_DATA_ARRIVE,OnDataArrivedMsg1)
END_MESSAGE_MAP()
LRESULT CJog::OnDataArrivedMsg1(WPARAM wParam,LPARAM lParam)
{
//处理收到的数据
int length=(int)lParam;
unsigned char* data=(unsigned char*)wParam;
MessageBoxW(_T("112"));
}
Jog.h
afx_msg LRESULT OnDataArrivedMsg1(WPARAM wParam,LPARAM lParam);
Start.cpp
CWnd* m_Joghwnd = FindWindowW(_T("CJog"), _T("JOG"))
::SendMessage(m_Joghwnd->GetSafeHwnd(),WM_JOG_DATA_ARRIVE,(WPARAM)buf,LPARAM(2));
消息没有收到怎么解决?没有执行OnDataArrivedMsg1消息处理函数怎么弄? 展开
BEGIN_MESSAGE_MAP(CJog, CDialog)
ON_MESSAGE(WM_JOG_DATA_ARRIVE,OnDataArrivedMsg1)
END_MESSAGE_MAP()
LRESULT CJog::OnDataArrivedMsg1(WPARAM wParam,LPARAM lParam)
{
//处理收到的数据
int length=(int)lParam;
unsigned char* data=(unsigned char*)wParam;
MessageBoxW(_T("112"));
}
Jog.h
afx_msg LRESULT OnDataArrivedMsg1(WPARAM wParam,LPARAM lParam);
Start.cpp
CWnd* m_Joghwnd = FindWindowW(_T("CJog"), _T("JOG"))
::SendMessage(m_Joghwnd->GetSafeHwnd(),WM_JOG_DATA_ARRIVE,(WPARAM)buf,LPARAM(2));
消息没有收到怎么解决?没有执行OnDataArrivedMsg1消息处理函数怎么弄? 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询