HELP regarding m_pCtrlSite
Hi,
I just noticed an error occuring constantly namely:
First-chance exception at 0x00fd9a11 (mfc71d.dll) in IViewRemote.exe: 0xC0000005: Access violation reading location 0xcdcdcdcd.
I tracked it down to a function:
Code:
void CWnd::SetWindowText(LPCTSTR lpszString)
{
ASSERT(::IsWindow(m_hWnd) || (m_pCtrlSite != NULL));
if (m_pCtrlSite == NULL)
::SetWindowText(m_hWnd, lpszString);
else
m_pCtrlSite->SetWindowText(lpszString);
}
It seems that the function works when m_pCtrlSite is not set, it works properly but when it is, the program causes an exception and crashes. I would really appreciate some insight into why that would happen. Thanks a lot,
Amish
persistent m_pCtrlSite ASSERTION solution
I am developing an MFC dialog with VC6 and started receiving
this nasty assertion after adding a slider control. I went back to
previous versions but the app continued to bomb out on the destruction
of other dialog controls when exiting app. The program hangs on checking
the m_pCtrlSite != NULL conditional in one of the windows containers.
I fixed the problem by just adding a do-nothing destructor to the main
dialog class:
CA2D_ConsoleDlg::~CA2D_ConsoleDlg()
{
return;
}
Don't know if this is Kosher, but it seems to work.
/curleyj