K
2003-10-14 04:14:22 UTC
I am unable to receive user-defined messages in a formview-
based object. Here are the relevant pieces of code.
h file:
-------
//{{AFX_MSG(CMyView)
afx_msg void OnLButtonDblClk(UINT nFlags, CPoint point);
afx_msg LRESULT OnMyButton(unsigned int iButtonID,
unsigned int iState);
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
cpp file:
---------
BEGIN_MESSAGE_MAP(CMyView, CFormView)
//{{AFX_MSG_MAP(CMyView)
ON_MESSAGE(HM_BUTTON, OnButton)
ON_WM_LBUTTONDBLCLK()
//}}AFX_MSG_MAP
...
END_MESSAGE_MAP()
HM_BUTTON is defined to be WM_APP+100
I use BroadcastSystemMessage to send this message from
another process.
This works fine if the receiver is not a form-view based
app. In the above case, I simply don't get the message.
TIA
based object. Here are the relevant pieces of code.
h file:
-------
//{{AFX_MSG(CMyView)
afx_msg void OnLButtonDblClk(UINT nFlags, CPoint point);
afx_msg LRESULT OnMyButton(unsigned int iButtonID,
unsigned int iState);
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
cpp file:
---------
BEGIN_MESSAGE_MAP(CMyView, CFormView)
//{{AFX_MSG_MAP(CMyView)
ON_MESSAGE(HM_BUTTON, OnButton)
ON_WM_LBUTTONDBLCLK()
//}}AFX_MSG_MAP
...
END_MESSAGE_MAP()
HM_BUTTON is defined to be WM_APP+100
I use BroadcastSystemMessage to send this message from
another process.
This works fine if the receiver is not a form-view based
app. In the above case, I simply don't get the message.
TIA