Re: Send message issue
hi Scott,
Thanks for response.
This i am calling in the columnclick of listctrlOne that means all
controls had been created and after that I am calling this function.The
debugger goes to this function when an item is clicked that means CView
::OninitilUpdate is already called,Right !
void CMyListCtrlOne::OnNMClick(NMHDR *pNMHDR, LRESULT *pResult)
{
FrameWnd * pFrame = (CFrameWnd *)(AfxGetApp()->m_pMainWnd);
//now get the view from that
CCMlView *mv = (CCMView*)pFrame->GetActiveView();
mv->m_myCtrlTab.userDlg->m_myListCtrlTwo.SendMessage(WM_INSERT_ITEMS,0,0);
}
What I wantto do is to send a message to ListCtrlTwo -myListCtrlTwo
when user clicks an item in ListCtrlOne.
Tom
Scott McPhillips [MVP] wrote:
nicetom786@yahoo.com wrote:
Hi David and Scotts,
Thanks for your response.I could get the concept of using SendMessage()
I used the function and I get an assertion which says the window is
null.
CView->Tabctrl->Dialog->CCMyListCtrl.mv->SendMessage(WM_INSERT_ITEMS,0,0);
//mv->m_myCtrlTab.userDlg->m_myListStudy_user_Ctrl.SendMessage(WM_INSERT_ITEMS,0,0);
How should I get the window to be not null.
This assertion usually means you have attempted to use a window that has
not been created yet. So the problem is probably that you are making
this call too early in the creation sequence. In a view, the controls
have not been created until after OnInitialUpdate calls
CView::OnInitialUpdate.
--
Scott McPhillips [VC++ MVP]