Thread: Best Practice? (Dialog vs .. Not Dialog?)

  1. #1
    #junkie
    Join Date
    Oct 2004
    Posts
    240

    Best Practice? (Dialog vs .. Not Dialog?)

    Well, as i am going through MSDN, trying to gather enough information to start peicing together anything not from a tutorial,

    i relized aside from functioning differently (doing little nifty things here and there), Do i need a dialog?

    Now dialogs look decent, their structure looks good and all so that may be the reason i use them..
    But honestly, all buttons, textfields (user input and program output), combo boxes, lists, ect.. are all just overglorified windows correct? Atleast thats the way theForgers tutorials made me feel. Everything is treated like a window, which makes sense in the most low level aspect, having the parent / child thing going on.

    But with all that said, strictly on terms of "Controls" (buttons, textfields(input & output), combo boxes, ect..), is there any advantage to using normal Windows vs Dialog Boxes?
    01110111011000010110110001100100011011110010000001 11000101110101011010010111010000100000011011000110 10010110011001100101001000000111100101101111011101 0100100000011011100111010101100010

  2. #2
    Chief Code Coloniser!
    Join Date
    Apr 2005
    Posts
    121
    When dealing with a straight GUI, it's totally up to you! Dialogs can be build from resources, and straight windows are generally "coded" instead of created from a resource.

    So it's not necessarily about what's better or worse in this case, it's more about what makes sense for the program you're building.

    Do I need a dialog
    Only you can answer that
    Last edited by TheColonial; 04-09-2005 at 04:03 AM.

  3. #3
    #junkie
    Join Date
    Oct 2004
    Posts
    240
    hmm, interesting. Given bigger projects, what would you suggest and what for reasons? I assume if i am involving OpenGL i would want a plain window, but without opengl / animation, it seems anything can be done with both of them right? Except some handle messages a bit dif.

    And i am still "coding" the resources, as i have no clue what all this visual editor junk is about and if Dev C++ has one lol.
    01110111011000010110110001100100011011110010000001 11000101110101011010010111010000100000011011000110 10010110011001100101001000000111100101101111011101 0100100000011011100111010101100010

  4. #4
    Chief Code Coloniser!
    Join Date
    Apr 2005
    Posts
    121
    Again it doesn't matter about the size of the project, it's what you need it to do that really matters.

    If you're going to be building a lot of screens for user input which aren't going to change, then it'd make more sense to use resources... but there are many scenarios where this doesn't necessarily make sense.

    I recommend playing around with both to get a good feel for the differences.. then use your experience and intuition to guide to the best solution for your problem.

    Good luck.

  5. #5
    Registered User VirtualAce's Avatar
    Join Date
    Aug 2001
    Posts
    9,607
    Dialogs are ok unless you need some specific action in that dialog. I derived one of my dialog classes from CDialogBar in MFC because I wanted docking functionality along with displaying a large bitmap on a grid. The bitmap is used to select tiles to place on the map you create.

    Standard dialogs and controls did not provide the functonality I needed, so I created a class for the dialog. But in most cases, the standard controls will suffice.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Replies: 9
    Last Post: 02-13-2008, 02:59 PM
  2. Edit controls of a dialog from another dialog...
    By Snake in forum Windows Programming
    Replies: 9
    Last Post: 07-01-2005, 02:18 PM
  3. make Child Dialog not Popup?
    By Zeusbwr in forum Windows Programming
    Replies: 5
    Last Post: 04-08-2005, 02:42 PM
  4. Getting the position of a dialog without parent on the screen
    By stormbringer in forum Windows Programming
    Replies: 1
    Last Post: 08-27-2003, 02:59 AM
  5. Tab Controls - API
    By -KEN- in forum Windows Programming
    Replies: 7
    Last Post: 06-02-2002, 09:44 AM