• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1381
  • Last Modified:

assert error in CFormView::Oninitialupdate()

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
orange_juice
Asked:
orange_juice
  • 9
  • 7
1 Solution
 
PacmanCommented:
in which file/line does the assert occur?
Debug into ASSERT and post the code of the assert.
0
 
orange_juiceAuthor Commented:
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
 
PacmanCommented:
press "Retry" to debug and jump to the line
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
orange_juiceAuthor Commented:
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
 
PacmanCommented:
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
 
orange_juiceAuthor Commented:
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
 
PacmanCommented:
did you trace back the call stack to see who called this function and from where the index comes ?
0
 
orange_juiceAuthor Commented:
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
 
PacmanCommented:
open the call stack window (menu "view / debug / call-stack").
0
 
orange_juiceAuthor Commented:
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
 
PacmanCommented:
there must be a control in your dialog resource with ID 1016 ... check it again.
0
 
orange_juiceAuthor Commented:
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
 
orange_juiceAuthor Commented:
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
 
orange_juiceAuthor Commented:
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
 
PacmanCommented:
>> 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
 
orange_juiceAuthor Commented:
i see, thank you
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

  • 9
  • 7
Tackle projects and never again get stuck behind a technical roadblock.
Join Now