Help:How to create multiple dialog boxes

  • 13 years ago

    Can anybdy help me please. I am learning Visual C++ 6.0 and developing MFC AppWizard applications.

    Q1)

    I try to add a user deifined diaolog box window to my application.  I name it as CMsgDlg and its base class is set to CDialog. When I create the user defined window by calling CDialog::DoModal() method, I seem to have 2 choices to close the window.  That is, in a function of the user-defined window, I could call either OnOK() or EndDialog().  I am not quite sure what they do! Do I call OnOK() to make the window invisible and call EndDialog() to destroy the window? The Help manual is not clear about  it! It seems to suggest that, for a user-defined modal window created by CDialog::DoModal(), both OnOK() and EndDialog() make the window invisible or both of them destroy the window!!  I am confused. Could anyone tell me (1) how to make the user-defined modal window just invisible, & (2) how to destroy it!!  The manual seems to suggest that, for a window created by CDiaolog::DoModal(), DestroyWIndow() method is not used at all!

     

    Q2)

    I have added the following 5 lines in my C++ program:

       char *pt;

       const char *cpt;

       CString Msg = "hello";

       cpt = (const char *)Msg; //This is OK!

      

Post a reply

No one has replied yet! Why not be the first?

Sign in or Join us (it's free).

Contribute

Why not write for us? Or you could submit an event or a user group in your area. Alternatively just tell us what you think!

Our tools

We've got automatic conversion tools to convert C# to VB.NET, VB.NET to C#. Also you can compress javascript and compress css and generate sql connection strings.

“A computer lets you make more mistakes faster than any other invention in human history, with the possible exceptions of handguns and tequila” - Mitch Ratcliffe