I get that message when clicking a specific button.
I saw somebody else had posted the same question earlier.
I ran debugger to trace the problem and it goes in the winocc.cpp file and specifically:
CWnd* CWnd::GetDlgItem(int nID) const
{
ASSERT(::IsWindow(m_hWnd)); // THIS LINE POINTED
if (m_pCtrlCont == NULL)
return CWnd::FromHandle(::GetDlgItem(m_hWnd, nID));
else
return m_pCtrlCont->GetDlgItem(nID);
}
Comments
What's the parent code?
: I get that message when clicking a specific button.
: I saw somebody else had posted the same question earlier.
: I ran debugger to trace the problem and it goes in the winocc.cpp file and specifically:
:
: CWnd* CWnd::GetDlgItem(int nID) const
: {
: ASSERT(::IsWindow(m_hWnd)); // THIS LINE POINTED
:
: if (m_pCtrlCont == NULL)
: return CWnd::FromHandle(::GetDlgItem(m_hWnd, nID));
: else
: return m_pCtrlCont->GetDlgItem(nID);
: }
:
I figured out where the problem is, but i dont know how to fix it.
The main class is CAlarmDlg and the derived one from which the code is running is System.
I have included the following line for a radio button that i am using.
CButton* pPower = (CButton*)GetDlgItem(IDC_POWER);
pPower->SetCheck(1);
This code is inside the System class and the IDC_POWER is in CAlarmDlg.
All your help is greatly appreciated.
Thanx.