Re: Modeles dialog box in sdi
- From: David Wilkinson <no-reply@xxxxxxxxxxxx>
- Date: Wed, 24 Jan 2007 11:01:44 -0500
Jack wrote:
I create and show a modeless dialog box in the View::OnInitial function. In
Debug mode everything looks fine but in Release mode the look of the dialog
box seems missing of some details. I display the dialog box at the beginning
of the function and later on there some some processing.
May questions-
Why should be any difference between the modes regarding the look?
If I pass the dialog box code (and the processing code) to a later stage of
the application, say in the OnPaint could that improve something?
Jack:
You mean CView::OnInitialUpdate(), no?
I don't know if this is your problem, or why you see different behavior in debug and release, but the MFC startup code in SDI is rather messed up, IMHO.
For example, I think you will find that in OnInitialUpdate(), AfxGetMainWnd() returns NULL, which can certainly cause assertion failures in some situations. One way to get around this is to do
AfxGetApp()->m_pMainWnd = this;
in your CMainFrame constructor.
Another thing you might try is having CVIew::OnInitialUpdate() post a custom message to the view, and open the modeless dialog in the handler. This would be better than doing it in OnPaint(), IMHO.
David Wilkinson
.
- References:
- Modeles dialog box in sdi
- From: Jack
- Modeles dialog box in sdi
- Prev by Date: Linker Error after upgrade from VC7.1
- Next by Date: VS 2005 C++ project - problem with activex controls
- Previous by thread: Re: Modeles dialog box in sdi
- Next by thread: To read the files from a particular folder
- Index(es):
Relevant Pages
|