I have no experience with MFC. I found program on the interten that could help me with my studies. I decided to change it a little, but problems come up. Program is a dialog application and uses 2 sliders that are connected to teht fields and problebly some other things. Connected means when set text field slider is moved. That slider are notr necessary and when I try to delete them by simply deleting from dialog form program crushes at runtime. It appears problem is in other file that I don't see in my solution explorer (Visual C++ .net) from example
in dlgdata.cpp
Code:
HWND CDataExchange::PrepareCtrl(int nIDC)
{
ASSERT(nIDC != 0);
ASSERT(nIDC != -1); // not allowed
HWND hWndCtrl;
COleControlSite* pSite = NULL;
m_pDlgWnd->GetDlgItem(nIDC, &hWndCtrl);
if (hWndCtrl == NULL)
{
// Could be a windowless OCX
pSite = m_pDlgWnd->GetOleControlSite(nIDC);
if (pSite == NULL)
{
TRACE(traceAppMsg, 0, "Error: no data exchange control with ID 0x%04X.\n", nIDC);
ASSERT(FALSE);//here's breakpoint
AfxThrowNotSupportedException();
}
}
m_idLastControl = nIDC;
m_bEditLastControl = FALSE; // not an edit item by default
return hWndCtrl;
}
in winocc.cpp
Code:
return m_pCtrlSite->ModifyStyleEx(dwRemove, dwAdd, nFlags);
}
void CWnd::SetWindowText(LPCTSTR lpszString)
{
ASSERT(::IsWindow(m_hWnd) || (m_pCtrlSite != NULL));
//again on ASSERT
if (m_pCtrlSite == NULL)
::SetWindowText(m_hWnd, lpszString);
else
m_pCtrlSite->SetWindowText(lpszString);
}
and in cther files.
I really don't have clue what is happening and would like to asike if someone who is good with MFC is willing to send him project by email to look this.
Thank you