|
-
April 14th, 1999, 02:45 AM
#1
VC6.0 App wizard generated app assertions.
Appwizard generates a program that causes assertions.
Apwizard was used in the following circumstances and the code generated cause assertion even
though no additional code had been added to the project.
MFC exe
1) Single Document no doc/view support.
2) No change
3) No change
4) No dockingtoolbar - no statusbar
5) No change
6) No change
Build and execute Program.
Error - >
Debug Assertion Failed!
Program C\....
File: winocc.cpp
Line: 331
If you just add doc/view support then there is no problem.
Simon Pettman.
Research Engineer
Goodmans Loudspeaker Ltd
Havant, UK.
[email protected]
-
April 14th, 1999, 04:58 AM
#2
Re: VC6.0 App wizard generated app assertions.
That's what the Doc/View framework is for!
If you don't use the Doc/View framework, there is no code included to create the view window for the main frame, so when it tries to set focus to the view, or pass it command messages, you will get an assert because the view window doesn't exist.
You have to create the view in the main frame yourself if you don't use Doc/View.
Dave
-
June 1st, 1999, 02:11 PM
#3
Re: VC6.0 App wizard generated app assertions.
In version 6 proper code for creation of the view is generated only if you choose toolbar and/or status bar.
It is obviously bug in ver 6.
Add handler for WM_CREATE message, and following code inside:
int CMainFrame::OnCreate(LPCREATESTRUCT lpCreateStruct)
{
if (CFrameWnd::OnCreate(lpCreateStruct) == -1)
return -1;
//added code
if (!m_wndView.Create(NULL, NULL, AFX_WS_DEFAULT_VIEW,
CRect(0, 0, 0, 0), this, AFX_IDW_PANE_FIRST, NULL))
{
TRACE0("Failed to create view window\n");
return -1;
}
//added code END
return 0;
}
John Cz
There are only 10 types of people in the world:
Those who understand binary and those who do not.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|