Problem with CDialog derived class - Programmer

This is a discussion on Problem with CDialog derived class - Programmer ; I used the app wizard to create an MFC Dialog based application. I created another dialog window that is opened via the pushing of a button on the main dialog. When this happens, however, the new dialog is not fully ...

+ Reply to Thread
Results 1 to 3 of 3

Thread: Problem with CDialog derived class

  1. Problem with CDialog derived class

    I used the app wizard to create an MFC Dialog based application. I
    created another dialog window that is opened via the pushing of a
    button on the main dialog. When this happens, however, the new dialog
    is not fully displayed (it distorts the client area of the main dialog
    where it should be displayed) and the application hangs. I assume
    that I did something incorrectly in creating the new dialog. Here is
    what I did:

    1. Added a new resource of type dialog and added a couple controls to
    it.
    2. Invoked the class wizard and derived a class from CDialog.
    Associated the class with the Dialog ID of the dialog resource I
    created.
    3. In the event handler for the appropriate control on the main
    dialog, added the following code:

    CMyNewDialog dlg;
    dlg.DoModal();

    I am using VC++.NET. Please let me know if you have any idea what the
    problem might be. Thanks!

  2. Re: Problem with CDialog derived class

    So far so good, which event handler are you calling the DoModal in?

    Ali R.

    "Keith" wrote in message
    news:8ac061bb.0402101031.56ebf44a@posting.google.c om...
    > I used the app wizard to create an MFC Dialog based application. I
    > created another dialog window that is opened via the pushing of a
    > button on the main dialog. When this happens, however, the new dialog
    > is not fully displayed (it distorts the client area of the main dialog
    > where it should be displayed) and the application hangs. I assume
    > that I did something incorrectly in creating the new dialog. Here is
    > what I did:
    >
    > 1. Added a new resource of type dialog and added a couple controls to
    > it.
    > 2. Invoked the class wizard and derived a class from CDialog.
    > Associated the class with the Dialog ID of the dialog resource I
    > created.
    > 3. In the event handler for the appropriate control on the main
    > dialog, added the following code:
    >
    > CMyNewDialog dlg;
    > dlg.DoModal();
    >
    > I am using VC++.NET. Please let me know if you have any idea what the
    > problem might be. Thanks!




  3. Re: Problem with CDialog derived class

    "Ali R." wrote in message news:...
    > So far so good, which event handler are you calling the DoModal in?
    >
    > Ali R.



    I'm calling DoModal from within an ON_BN_CLICKED event handler. I
    tried calling it from a couple other event handlers just to test it,
    but still no luck.

+ Reply to Thread