OnClose() in MDI Mainframe works fine in debug version but not in release 
Author Message
 OnClose() in MDI Mainframe works fine in debug version but not in release

Hi.

I have an MDI app that first starts with a login dialog screen. The screen
fills the whole monitor screen and consists of a login dialog. Since my
mainframe is not yet created at startup, the login screen works fine.
When I exit my mainframe window (e.g. by system menu), the login screen
reappears (new creation through CMyApp::LoginExit-function, see below).
The debug version works fine but the release doesn't. In release, when I
exit my mainframe window the login screen is not at top, only the login
dialog is. In the background there is still my Mainframe window which I have
hided with CWnd::ShowWindow(SW_HIDE).
Is there anyone who knows, why the release version does not work although
the debug version works fine?

Thanx for help,
Guido

Here's my code:

// ****** The mainframe OnClose handler ....

class CMainFrame : public CMDIFrameWnd;

void CMainFrame::OnClose()
{
 CWnd::ShowWindow(SW_HIDE);

 // Login/Exit Dialog
 int ir = ((CMyApp*)AfxGetApp())->LoginExit();
 if (ir == IDLOGIN)
 {
  // new Login ok
  CWnd::ShowWindow(SW_SHOW);
 }
 else if (ir == IDEXITAPP)
 {
  // Exit app
  CMDIFrameWnd::OnClose();
 }

Quote:
}

// ******* The app routine ....

class CMyApp : public CWinApp;

int CMyApp::LoginExit()
{
 // LoginExit Screen
 CLoginExitScreen screen;

 int ir = screen.Show();
 return ir;

Quote:
}

// ******** The LoginExit screen ...

class CLoginExitScreen : public CFrameWnd;

CLoginExitScreen::CLoginExitScreen()
{
 Create(NULL, "", WS_VISIBLE | WS_MAXIMIZE | WS_DLGFRAME | WS_POPUP);
 ShowWindow(SW_SHOWMAXIMIZED);

Quote:
}

int CLoginExitScreen::Show()
{
 // return values:  IDLOGIN    .. Login ok
 //                      IDEXITAPP .. Exit app

 CLoginExitDlg dlg;
 int ir = dlg.DoModal();
 if (ir == IDOK)
      return IDLOGIN;

 return IDEXITAPP;

Quote:
}



Sat, 14 Dec 2002 03:00:00 GMT  
 
 [ 1 post ] 

 Relevant Pages 

1. debug version works fine, but release not.

2. Debug version program works fine but its release version causes a GP error

3. Debug version works, Release version does not?!

4. DLL works fine in DEBUG but not in RELEASE mode

5. Program in debug version works but not in release version

6. ASSERT in debug version, fine in release version

7. Works in debug version, not in release - CryptoAPI _ATL_MIN_CRT

8. Debug version Works Release does not!

9. Release versions crashes, debug is fine

10. MIDL compiler fails during release mode but works fine in debug mode

11. Debug version works, Release version doesn't

12. Help: Debug-Version works, Release-Version crashes!

 

 
Powered by phpBB® Forum Software