Whilst running my application, I am getting the following error, when the program try's to execute the command "UpdateData(True)"
"Debug Assertion Failed!
The message box gives the options to: Abort, retry and Ignore. When you retry or ignore the program crashes.
On pressing the retry button, the debugger points to the first ASSERT statement below.
void AFXAPI DDX_Control(CDataExchange* pDX, int nIDC, CWnd& rControl)
if (rControl.m_hWnd == NULL) // not subclassed yet
HWND hWndCtrl = pDX->PrepareCtrl(nIDC);
ASSERT(FALSE); // possibly trying to subclass twice?
// If the control has reparented itself (e.g., invisible control),
// make sure that the CWnd gets properly wired to its control site.
if (pDX->m_pDlgWnd->m_hWnd != ::GetParent(rControl.m_hWnd))
I checked to make sure that the :DoDataExchange function is not refering to any control which does is not present in the dialog.
After tracing though the code, the assertion error occurs on the first line of the code in the DoDataExchange function, i.e
DDX_Control(pDX, IDC_BTNSPECIALOFFERS, m_ctlBtnSpecialOffers);
However it appears to work on DDX_Text macros. I have also tried: m_bSaveAndValidate = True, but still this does not make any difference.
This application works fine under Visual C++ 2.0 using ODBC, but I am experiencing the above problem when converting the application to Visual C++ 4.0 using DAO.
Is anyone aware of the possible cause of this error. I have double checked the DoDataExchange() function and there appears to be nothing wrong with it.
I very much look forward to any suggestions of the possible cause of this error. Please reply by e-mail: AsifMughal@aol.com