Following the MSDN instructions, I've done the following:
1) In my Dialog's header file, I put "afx_msg void OnDataReady();" between
the Wizard defined message declarations and the DECLARE_MESSAGE_MAP()
statement.
2) I #defined "WM_DATAREADYMSG (WM_USER + 100)"
3) In the message map I put "ON_MESSAGE(WM_DATAREADYMSG, OnDataReady)"
4) In the Dialog's .cpp file I made a function " void
CMyDlg::OnDataReady()"
The compiler says:
error C2642: cast to pointer to member must be from related pointer to
member
Whazzat?
TIA
drc
afx_msg LRESULT OnNew(WPARAM wParam, LPARAM lParam);
Scott McPhillips wrote:
>
> You've got the function prototype wrong. Its return type and parameters must
> match this:
>
> afx_msg LRESULT OnNew(WPARAM wParam, LPARAM lParam);
Thanks. What's the recommended return value (zero seems to work, but I
don't want any surprises).
drc
--
Dave Cullen
Real Address: dcullen at prox dot com
>I want to add a custom message handling function to my Dialog app. It will
>be called when a data aquisition thread has data ready for display.
>
>2) I #defined "WM_DATAREADYMSG (WM_USER + 100)"
>
Microsoft now asks that user-defined messages start at WM_APP instead
of WM_USER because some of the new common controls actually use messages
above WM_USER.
See KB article Q86835.
------------------------------------------------------------------------
Andy Yee Corporate E-Mail: See Above
Software Engineer Coporate Web Page: http://www.jasc.com
Jasc Software, Inc. Personal E-Mail: n...@yuck.net
Personal Web Page: http://www.visi.com/~nde
Question authority...and the authorities will question YOU!
------------------------------------------------------------------------
The general rule for LRESULT (a Win32 rule) is to return 0 if you handle the
message. If you don't the MFC macro might choke or it might just pass it on to
default handlers that never heard of your custom message.