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));