Solved

assert error in CFormView::Oninitialupdate()

Posted on 2001-09-07
16
1,292 Views
Last Modified: 2013-11-20
I'm using a SDI CFormView derived application... Let say my viewclass is CMyappView

   I have put some controls, some of which i downloaded from codeproject, on my screen. Previously, it has been running ok.
  out of sudden, i don't know what i did, it has this error: my program can't even start. the error is in

 CMyappView::OninitialUpdate()
{
    CFormview::OninitialUpdate();  
//this line cause an assert
    ........(other code)
}

i get an assert error just after i run that line
i don't know how to solve this, please help

when i trace deeper into the CFormView::OnintialUpdate()

    this line cause an assert

     if(!UpdateData(False))

thanks  : )
0
Comment
Question by:orange_juice
  • 9
  • 7
16 Comments
 
LVL 9

Expert Comment

by:Pacman
Comment Utility
in which file/line does the assert occur?
Debug into ASSERT and post the code of the assert.
0
 
LVL 1

Author Comment

by:orange_juice
Comment Utility
Debug assertion failed
.........
file: dlgdata.cpp
line: 43

when i try to debug (by pressing the retry--- there is abort, retry, cancel on the debug assertion error dialog), an illegal operation occured...and i see nothing

where is the code of the assert?
0
 
LVL 9

Expert Comment

by:Pacman
Comment Utility
press "Retry" to debug and jump to the line
0
 
LVL 1

Author Comment

by:orange_juice
Comment Utility
well,
  i suppose i have mentioned that line at the very first of my question? or , i miss anything?
   though i still don't know how to correct it
0
 
LVL 9

Accepted Solution

by:
Pacman earned 50 total points
Comment Utility
What I want is the lines of code where something like

ASSERT( .... )

stands.
The line which "throws" the assert.
That's the point of interest.

Ok it's dlgdata.cpp and line 43.
Can you post the code of this area (maybe the function till line 43).
0
 
LVL 1

Author Comment

by:orange_juice
Comment Utility
HWND CDataExchange::PrepareCtrl(int nIDC)
{
     ASSERT(nIDC != 0);
     ASSERT(nIDC != -1); // not allowed
     HWND hWndCtrl;
     m_pDlgWnd->GetDlgItem(nIDC, &hWndCtrl);
     if (hWndCtrl == NULL)
     {
          TRACE1("Error: no data exchange control with ID 0x%04X.\n", nIDC);
          ASSERT(FALSE);
          AfxThrowNotSupportedException();
     }
     m_hWndLastControl = hWndCtrl;
     m_bEditLastControl = FALSE; // not an edit item by default
     ASSERT(hWndCtrl != NULL);   // never return NULL handle
     return hWndCtrl;
}

that is the place where assert fail: dlgdata.cpp line 43
dlgdata is MFC file

the error message is
     Error:no data exchange control with ID 0x03F8

in fact i really don't have such ID in my resource file, but how to solve this??
0
 
LVL 9

Expert Comment

by:Pacman
Comment Utility
did you trace back the call stack to see who called this function and from where the index comes ?
0
 
LVL 1

Author Comment

by:orange_juice
Comment Utility
i actually have this error on the very beginning of my program start up cycle

   in CFormView::OnInitialUpdate()

i have not trace the call stack though.....how to use that? let me try and see
0
IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

 
LVL 9

Expert Comment

by:Pacman
Comment Utility
open the call stack window (menu "view / debug / call-stack").
0
 
LVL 1

Author Comment

by:orange_juice
Comment Utility
i guess i don't know how to get any useful info' from call stack.... anyway, i copy all those thing...help me. i see that 0x3f8, but still don't know how it comes

CDataExchange::PrepareCtrl(int 0x000003f8) line 43 + 25 bytes
DDX_Control(CDataExchange * 0x0069f470, int 0x000003f8, CWnd & {CWnd hWnd=0x00000000}) line 626 + 12 bytes
CAutopanelView::DoDataExchange(CDataExchange * 0x0069f470) line 104
CWnd::UpdateData(int 0x00000000) line 3109
CFormView::OnInitialUpdate() line 125 + 10 bytes
CAutopanelView::OnInitialUpdate() line 124
CWnd::OnWndMsg(unsigned int 0x00000364, unsigned int 0x00000000, long 0x00000000, long * 0x0069f9c8) line 1825
CWnd::WindowProc(unsigned int 0x00000364, unsigned int 0x00000000, long 0x00000000) line 1585 + 30 bytes
AfxCallWndProc(CWnd * 0x008c4694 {CAutopanelView hWnd=0x00000740}, HWND__ * 0x00000740, unsigned int 0x00000364, unsigned int 0x00000000, long 0x00000000) line 215 + 26 bytes
CWnd::SendMessageToDescendants(HWND__ * 0x0000071c, unsigned int 0x00000364, unsigned int 0x00000000, long 0x00000000, int 0x00000001, int 0x00000001) line 2309
CWnd::SendMessageToDescendants(unsigned int 0x00000364, unsigned int 0x00000000, long 0x00000000, int 0x00000001, int 0x00000001) line 146 + 32 bytes
CFrameWnd::InitialUpdateFrame(CDocument * 0x009d1740 {CAutopanelDoc}, int 0x00000001) line 753
CDocTemplate::InitialUpdateFrame(CFrameWnd * 0x009d15d0 {CMainFrame hWnd=???}, CDocument * 0x009d1740 {CAutopanelDoc}, int 0x00000001) line 332
CSingleDocTemplate::OpenDocumentFile(const char * 0x00000000, int 0x00000001) line 205
CDocManager::OnFileNew() line 829
CWinApp::OnFileNew() line 29
_AfxDispatchCmdMsg(CCmdTarget * 0x0045b048 class CAutopanelApp  theApp, unsigned int 0x0000e100, int 0x00000000, void (void)* 0x00433772 CWinApp::OnFileNew, void * 0x00000000, unsigned int 0x0000000c, AFX_CMDHANDLERINFO * 0x00000000) line 88
CCmdTarget::OnCmdMsg(unsigned int 0x0000e100, int 0x00000000, void * 0x00000000, AFX_CMDHANDLERINFO * 0x00000000) line 302 + 39 bytes
CWinApp::ProcessShellCommand(CCommandLineInfo & {CCommandLineInfo}) line 31 + 30 bytes
CAutopanelApp::InitInstance() line 94 + 12 bytes
AfxWinMain(HINSTANCE__ * 0x00400000, HINSTANCE__ * 0x00000000, char * 0x81679615, int 0x00000001) line 39 + 11 bytes
WinMain(HINSTANCE__ * 0x00400000, HINSTANCE__ * 0x00000000, char * 0x81679615, int 0x00000001) line 30
WinMainCRTStartup() line 330 + 54 bytes
KERNEL32! bff8b560()
KERNEL32! bff8b412()
KERNEL32! bff89dd5()
0
 
LVL 9

Expert Comment

by:Pacman
Comment Utility
there must be a control in your dialog resource with ID 1016 ... check it again.
0
 
LVL 1

Author Comment

by:orange_juice
Comment Utility
yes, there is.
  how you know that? it is not in the call_stack
and what should i don with it?
 now i am still looking at my code
0
 
LVL 1

Author Comment

by:orange_juice
Comment Utility
yes, there is.
  how you know that? it is not in the call_stack
and what should i don with it?
 now i am still looking at my code
0
 
LVL 1

Author Comment

by:orange_juice
Comment Utility
now, i throw away the control with ID 1016
and it still assert, now instead of 0x3f8, i have a not found control 0x3f7

 any idea..........??
0
 
LVL 9

Expert Comment

by:Pacman
Comment Utility
>> how you know that? it is not in the call_stack
and what should i don with it?

The assert said:
"Error:no data exchange control with ID 0x03F8 "

It prints the ID of the control: 0x03F8 which is 1016 in decimal system.
0
 
LVL 1

Author Comment

by:orange_juice
Comment Utility
i see, thank you
0

Featured Post

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

This is to be the first in a series of articles demonstrating the development of a complete windows based application using the MFC classes.  I’ll try to keep each article focused on one (or a couple) of the tasks that one may meet.   Introductio…
Introduction: Dialogs (2) modeless dialog and a worker thread.  Handling data shared between threads.  Recursive functions. Continuing from the tenth article about sudoku.   Last article we worked with a modal dialog to help maintain informat…
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…

743 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now