Solved

assert error in CFormView::Oninitialupdate()

Posted on 2001-09-07
16
1,307 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
ID: 6463811
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
ID: 6464305
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
ID: 6469698
press "Retry" to debug and jump to the line
0
Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
LVL 1

Author Comment

by:orange_juice
ID: 6472568
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
ID: 6474050
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
ID: 6482206
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
ID: 6482438
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
ID: 6484468
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
 
LVL 9

Expert Comment

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

Author Comment

by:orange_juice
ID: 6490671
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
ID: 6490744
there must be a control in your dialog resource with ID 1016 ... check it again.
0
 
LVL 1

Author Comment

by:orange_juice
ID: 6492943
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
ID: 6492944
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
ID: 6492950
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
ID: 6493115
>> 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
ID: 6493166
i see, thank you
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
iSeries FTP Exit Program 8 146
iSeries DB2 Query 2 97
Excel file not created as expected 7 79
Way to decrease size of apk file 9 86
Introduction: Finishing the grid – keyboard support for arrow keys to manoeuvre, entering the numbers.  The PreTranslateMessage function is to be used to intercept and respond to keyboard events. Continuing from the fourth article about sudoku. …
Introduction: Database storage, where is the exe actually on the disc? Playing a game selected randomly (how to generate random numbers).  Error trapping with try..catch to help the code run even if something goes wrong. Continuing from the seve…
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.

809 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