Re: Send message issue
Ajay,
This is where it breaks
ASSERT_VALID(mv->m_myCtrlTab.userDlg);
and goes to objcore.cpp line no 90
// check to make sure the VTable pointer is valid
ASSERT(sizeof(CObject) == sizeof(void*));
if (!AfxIsValidAddress(*(void**)pOb, sizeof(void*), FALSE))
{
TRACE(traceAppMsg, 0, "ASSERT_VALID fails with illegal
vtable
pointer.\n");
if (AfxAssertFailedLine(lpszFileName, nLine))
AfxDebugBreak();
return; // quick escape
}
How to correct this ?
Pls guide.
Scott McPhillips [MVP] wrote:
nicetom786@yahoo.com wrote:
Ajay,
I did not confirm from Spy++.
the debugger breaks at
mv->m_myCtrlTab->mydialog->m_ListCtrlTwo.SendMessage(WM_INSERT_ITEMS,0,0);
stating the window of is null.
This is really ugly stuff and we're not going to be able to figure it
out without you doing some analysis. You've got 8 ways this statement
can go awry and you have not yet ruled out any of them. Also, it looks
like you are treating objects (m_myCtrlTab, mydialog) as pointers. That
shouldn't even compile.
Give this a try to see if one of these variables is not valid, and see
if you can fix as necessary to get this much to work:
ASSERT_VALID(mv);
ASSERT_VALID(mv->m_myCtrlTab);
ASSERT_VALID(mv->m_myCtrlTab->mydialog);
ASSERT_VALID(mv->m_myCtrlTab->mydialog->m_ListCtrlTwo);
When that works then try some more testing like:
ASSERT_VALID(*mv);
ASSERT(mv->GetSafeHwnd());
ASSERT_VALID(mv->m_myCtrlTab);
ASSERT(mv->m_myCtrlTab.GetSafeHwnd());
etc.
--
Scott McPhillips [VC++ MVP]