Invalid Page Fault from CDialog.DoModal() 
Author Message
 Invalid Page Fault from CDialog.DoModal()

In my application I have subclassed CDialog.  When I call the DoModal
function while in debug, everything works fine.  When I attempt it from the
release build, I get an invalid page fault.  Does anyone have a hint for me?
Following is my code:

CMyDialog dlg(pf, INCHES);    // constructor for subclassed CDialog
if (dlg.DoModal()==IDOK)        // DoModal is not over-ridden, so
CDialog.DoModal is called
{
    // do stuff

Quote:
}

Thanks in advance,

Clyde Gerber



Tue, 24 Apr 2001 03:00:00 GMT  
 Invalid Page Fault from CDialog.DoModal()
What is the call stack for it?

--

http://www.gipsysoft.com -The home of  Zoom+, The Ultimate Screen
Magnification Utility.
GipsySoft, cool tools, source code and utilities.

Quote:

>In my application I have subclassed CDialog.  When I call the DoModal
>function while in debug, everything works fine.  When I attempt it from the
>release build, I get an invalid page fault.  Does anyone have a hint for
me?
>Following is my code:

>CMyDialog dlg(pf, INCHES);    // constructor for subclassed CDialog
>if (dlg.DoModal()==IDOK)        // DoModal is not over-ridden, so
>CDialog.DoModal is called
>{
>    // do stuff
>}

>Thanks in advance,

>Clyde Gerber




Wed, 25 Apr 2001 03:00:00 GMT  
 Invalid Page Fault from CDialog.DoModal()
I should mention that I'm using version 4.0 of Visual C++.  I also have the
linker set to use MFC in a static library.  When I switch to using MFC in a
shared DLL, I do not get the invalid page fault in either the debug or
release version.  Static linking works only for the debug version -- I get
the invalid page fault in the the release version.  When I run it through
debug, the call stack looks as follows right after the DoModal call:

CDialog::DoModal() line 435
CODBCView::OnParagraph() line 676 + 11 bytes
DispatchCmdMsg(CCmdTarget * 0x0109ec5c {CTaskView hWnd=0x000005c4}, unsigned
int 32787, int 0, void (void)* 0x004015aa, void * 0x00000000, unsigned int
12, AFX_CMDHANDLERINFO * 0x00000000) line 109
CCmdTarget::OnCmdMsg(unsigned int 32787, int 0, void * 0x00000000,
AFX_CMDHANDLERINFO * 0x00000000) line 275 + 39 bytes
CView::OnCmdMsg(unsigned int 32787, int 0, void * 0x00000000,
AFX_CMDHANDLERINFO * 0x00000000) line 160 + 24 bytes
CFrameWnd::OnCmdMsg(unsigned int 32787, int 0, void * 0x00000000,
AFX_CMDHANDLERINFO * 0x00000000) line 904 + 37 bytes
CWnd::OnCommand(unsigned int 32787, long 0) line 2107 + 23 bytes
CFrameWnd::OnCommand(unsigned int 32787, long 0) line 309 + 16 bytes
CWnd::OnWndMsg(unsigned int 273, unsigned int 32787, long 0, long *
0x0083f944) line 1629 + 25 bytes
CWnd::WindowProc(unsigned int 273, unsigned int 32787, long 0) line 1617 +
30 bytes
AfxCallWndProc(CWnd * 0x0109e75c {CChildFrame hWnd=0x00000580}, HWND__ *
0x00000580, unsigned int 273, unsigned int 32787, long 0) line 209 + 26
bytes
CMDIFrameWnd::OnCommand(unsigned int 32787, long 0) line 54 + 39 bytes
CWnd::OnWndMsg(unsigned int 273, unsigned int 32787, long 0, long *
0x0083fb30) line 1629 + 25 bytes
CWnd::WindowProc(unsigned int 273, unsigned int 32787, long 0) line 1617 +
30 bytes
AfxCallWndProc(CWnd * 0x01092928 {CMainFrame hWnd=0x00000b74}, HWND__ *
0x00000b74, unsigned int 273, unsigned int 32787, long 0) line 209 + 26
bytes
AfxWndProc(HWND__ * 0x00000b74, unsigned int 273, unsigned int 32787, long
0) line 362 + 25 bytes
KERNEL32! bff735d9()
KERNEL32! bff9222f()
00838c44()

Is there a way to look at the call stack when executing the release build?

Quote:
>What is the call stack for it?

>--

>http://www.gipsysoft.com -The home of  Zoom+, The Ultimate Screen
>Magnification Utility.
>GipsySoft, cool tools, source code and utilities.


>>In my application I have subclassed CDialog.  When I call the DoModal
>>function while in debug, everything works fine.  When I attempt it from
the
>>release build, I get an invalid page fault.  Does anyone have a hint for
>me?
>>Following is my code:

>>CMyDialog dlg(pf, INCHES);    // constructor for subclassed CDialog
>>if (dlg.DoModal()==IDOK)        // DoModal is not over-ridden, so
>>CDialog.DoModal is called
>>{
>>    // do stuff
>>}

>>Thanks in advance,

>>Clyde Gerber




Wed, 25 Apr 2001 03:00:00 GMT  
 Invalid Page Fault from CDialog.DoModal()
You can easily enable debug information in a release build, simply go to the
project settings and enable debug info on the C/C++ tab and on the link tab.

From your call stack I cannot tell why it would crash.

Prime candidates for different debug/release behaviour are:
* Code differences, that is you are using a different set of code in debug
and release.
* Using ASSERT where you shoudl have used VERIFY so some crucial bit of code
has been compiled out. Try doing a fnd in files for ASSERT and check each
one. Also worth checking #ifdef _DEBUG code too.
* Uninitialised memory, you have failed to initialise some variable to a
known value. This is very common.

There are some good tools that can help you out with this kind of thing and
are useful to have around in any case, not cheap though:
* Numegas Boundchecker will perform runtime checking, it will build an
instrumented version of your code and check for resouce leaks, memory
overruns and uses of variables that have not been initailies.
* Gimpels PC LINT is a static source code checker, this will usually root
out any unintialised variables and will do a hell of a lot more.

I use both, to be sure.

--

http://www.gipsysoft.com -The home of  Zoom+, The Ultimate Screen
Magnification Utility.
GipsySoft, cool tools, source code and utilities.

Quote:

>I should mention that I'm using version 4.0 of Visual C++.  I also have the
>linker set to use MFC in a static library.  When I switch to using MFC in a
>shared DLL, I do not get the invalid page fault in either the debug or
>release version.  Static linking works only for the debug version -- I get
>the invalid page fault in the the release version.  When I run it through
>debug, the call stack looks as follows right after the DoModal call:

[snip]

Quote:
>Is there a way to look at the call stack when executing the release build?


[snip]


Wed, 25 Apr 2001 03:00:00 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. Invalid page fault in Windows98

2. Invalid Page Fault?

3. Invalid page faults when accessing large arrays

4. caused an invalid page fault in module ...

5. Invalid Page fault in module MSJT3032.DLL

6. Invalid page fault

7. Invalid page fault

8. invalid page fault

9. Invalid Page Fault in Release mode with ML compiler option

10. invalid page fault ...

11. MSDEV caused an invalid page fault in Module SSSCC.DLL After Install SP2

12. invalid page fault when I exit my program

 

 
Powered by phpBB® Forum Software