Thread: Mingw Dialog Box resources

  1. #1
    ¡Amo fútbol!
    Join Date
    Dec 2001
    Posts
    2,138

    Mingw Dialog Box resources

    Is anyone here familiar with mingw's dialog box resources? I can't seem to get mine to work. Here is the code:

    Code:
    #include <windows.h>
    
    IDpWindow DIALOGEX 7, 20, 195, 127
    STYLE DS_MODALFRAME | WS_POPUP | WS_VISIBLE | WS_CAPTION
    FONT 10, "Helv"
    BEGIN
        DEFPUSHBUTTON   "OK", IDpOKbut, 31, 98, 40, 14
        PUSHBUTTON      "Cancel", IDpCancelbut, 103, 97, 40, 14
        EDITTEXT        IDpEdit1, 69, 12, 91, 12, ES_AUTOHSCROLL | WS_VISIBLE | ES_LEFT
        EDITTEXT        IDpEdit2, 69, 29, 91, 12, ES_AUTOHSCROLL | WS_VISIBLE | ES_LEFT
        LTEXT           "string1", 103, 16, 14, 48, 12
        LTEXT           "string2", 104, 15, 31, 46, 12
        LTEXT           "string3", 105, 15, 48, 49, 12
        EDITTEXT        IDpEdit3, 69, 47, 91, 12, ES_AUTOHSCROLL | WS_VISIBLE | ES_LEFT
        LTEXT           "string4", 107, 15, 67, 50, 12
        EDITTEXT        IDpEdit4, 69, 66, 91, 12, ES_AUTOHSCROLL | WS_VISIBLE | ES_LEFT
    END
    Gives me an error on line 3. IDpWindow is already defined also. I tried going back to the old DIALOG instead of DIALOGEX but it didn't work. It is probably a stupid mistake, so thanks for even looking at this.

  2. #2
    Banned master5001's Avatar
    Join Date
    Aug 2001
    Location
    Visalia, CA, USA
    Posts
    3,685
    It compiled just fine for me, which suggests that you are doing something wrong with the #defines and your control ID's. You should put all your control ID's in a resource header file and include it in both the resource file and your application file.

  3. #3
    ¡Amo fútbol!
    Join Date
    Dec 2001
    Posts
    2,138
    Found it. Had a typo.

  4. #4
    Banned master5001's Avatar
    Join Date
    Aug 2001
    Location
    Visalia, CA, USA
    Posts
    3,685
    I kinda figured as much. The first thing I did was change all of your control ID's to numbers and it compiled without any trouble. I'm glad you got everything in order.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Replies: 9
    Last Post: 02-13-2008, 02:59 PM
  2. Parent of a BrowseForFolder dialog box
    By @nthony in forum Windows Programming
    Replies: 4
    Last Post: 01-08-2007, 02:54 PM
  3. New Theme
    By XSquared in forum A Brief History of Cprogramming.com
    Replies: 160
    Last Post: 04-01-2004, 08:00 PM
  4. Dialog Box Resources
    By Mecnels in forum Windows Programming
    Replies: 2
    Last Post: 04-28-2003, 05:57 AM
  5. Tab Controls - API
    By -KEN- in forum Windows Programming
    Replies: 7
    Last Post: 06-02-2002, 09:44 AM