CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Join Date
    Apr 1999
    Posts
    16

    A simple question about Modeless Dialogs...

    When my program starts, it is supposed to have a modeless dialog box displayed ontop of the main application window. However, when the program starts this is not what happens.

    First, the dialog box appears as I would expect, but then the Dialog box is covered up by the main application's window.

    My dialog box is a member of the CMainFrame class, and I attempt to display the dialog at the very end of the CMainFrame::OnCreate function. Doing this works with MDI applications, but not with SDI applications for some reason.

    Any help would be appriciated.
    Mike.


  2. #2
    Join Date
    Apr 1999
    Location
    CA, USA
    Posts
    78

    Re: A simple question about Modeless Dialogs...

    A simple solution:
    1. create a public function in CMainFrame class, e.g., ShowMyDialog() and put those codes to display the modeless dislog.
    2. call this function in the App's InitInstance(), but call it after initializing MainFrame:
    pMainFrame->ShowWindow(SW_SHOWMAXIMIZED);
    pMainFrame->UpdateWindow();
    pMainFrame->ShowMyDialog();

    Hope this will help. Good luck.

    Lynx


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured