Re: Send message issue
You may want to check the return from GetCurrentView() before doing this
call just as a sane practice sort of thing. You could also call SendMessage
in the CWnd * object:
CMyView* pView = GetCurrentView();
if(pView != NULL) {
pView->SendMessage(WM_MYMESSAGE,0,0);
}
Or, if you don't want to wait for a return, you could use PostMessage()
instead.
As Ajay said, you can send or post messages to any window. Of course, only
the windows with handlers for those messages will do anything with them.
Tom
<nicetom786@yahoo.com> wrote in message
news:1149274724.117960.295000@i39g2000cwa.googlegroups.com...
Hi Ajay,
this is how I am sending it from Document.
SendMessage(GetCurrntView()->m_myListctrl,
WM_MY_MESSAGE,
0,
0);
And in the MyListCTRL.PP
I have to implement hander for WM_MY_MESSAGE()
Let me know is this correct
thanks
Tom
Ajay Kalra wrote:
Can SendMessage can be used to send a message from document to a window
which is subclassed
Yes. You can use SendMessage from anywhere as long as you are sending it
to
a window.
--
Ajay Kalra [MVP - VC++]
ajaykalra@yahoo.com