Thread: CDialog help

  1. #1
    Registered User
    Join Date
    Aug 2002
    Posts
    1

    Question CDialog help

    Hi,

    I am pretty new to MFC and have been having big problems for the last few weeks trying to show a simple dialog box from a resource file.

    The compiler I'm using is MetroWerks CodeWarrior v4 and all attempts to make a dialog box display have failed, either with errors or just nothing appearing.

    Could someone please post the program to just display a dialog box IDD_DIALOG1 from a resource file: resource1.res - I think I must be doing something really simple wrong?

    Thanks

  2. #2
    train spotter
    Join Date
    Aug 2001
    Location
    near a computer
    Posts
    3,868
    Why not post what you have and we will correct, will get a better response than asking us to write the code for you.

    Ensure you are including 'resource.h' and 'script.rc' to use a dialog from resouce.

    Check the return from the createDialog() or similar and if NULL call GetLastError() to help you debug.
    "Man alone suffers so excruciatingly in the world that he was compelled to invent laughter."
    Friedrich Nietzsche

    "I spent a lot of my money on booze, birds and fast cars......the rest I squandered."
    George Best

    "If you are going through hell....keep going."
    Winston Churchill

  3. #3
    Registered User
    Join Date
    Dec 2001
    Posts
    43

    Arrow

    First of all you must make a class for your dialog:
    I suppose you have a project and a dialog box , and just want to connect between them?

    1/ on an empty erea of the dialog box ; click the right mouse botton -->> select : ClassWizard; and agree creating the class.
    look at the name of the class : it's the dialog box class.. i.e
    (DialogClass).
    2/ in the View Class , and in any function you want (up to your desire) and creat new object of the dialog class:

    DialogClass dlg

    after that call the DoModal function :

    dlg.DoModal();

    and it will apear.
    Last edited by c--; 09-01-2002 at 07:26 AM.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. CDialog - Assertion Falied!
    By magic.mike in forum Windows Programming
    Replies: 3
    Last Post: 08-10-2005, 09:15 AM
  2. CToolBar wth CDialog
    By cfrost in forum Windows Programming
    Replies: 0
    Last Post: 07-07-2005, 04:30 AM
  3. CDialog VS CFormView
    By axr0284 in forum Windows Programming
    Replies: 3
    Last Post: 02-04-2005, 03:59 PM
  4. CDialog actions after appearing
    By phil_drew in forum Windows Programming
    Replies: 0
    Last Post: 12-06-2002, 07:13 AM
  5. CDialog & Multithreading :: MFC
    By kuphryn in forum Windows Programming
    Replies: 0
    Last Post: 06-19-2002, 05:15 PM