Thread: problem creating dialogs

  1. #1
    Registered User
    Join Date
    Nov 2004
    Posts
    18

    problem creating dialogs

    Hi, I'm just going through theForger's tutorial for win32 API, and have got to the bit about dialog boxes. I've added this code to my resource file:
    Code:
    IDD_ABOUT DIALOG DISCARDABLE  0, 0, 239, 66
    STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
    CAPTION "My About Box"
    FONT 8, "MS Sans Serif"
    BEGIN
        DEFPUSHBUTTON   "&OK",IDOK,174,18,50,14
        PUSHBUTTON      "&Cancel",IDCANCEL,174,35,50,14
        GROUPBOX        "About this program...",IDC_STATIC,7,7,225,52
        CTEXT           "An example program showing how to use Dialog Boxes\r\n\r\nby theForger",
                        IDC_STATIC,16,18,144,33
    END
    But when I compile the .rc using windres from the MinGW package it comes up with a parse error at the GROUPBOX line, and then when I comment that out there's another one at the CTEXT line. When both are commented out it will compile and run and produce the dialog, but obviously I need to be able to display text and such.
    Can anyone tell me why this isn't working and how to fix it?

    Thanks.
    Last edited by richardfish; 11-23-2004 at 03:56 PM. Reason: formatting text

  2. #2
    Yes, my avatar is stolen anonytmouse's Avatar
    Join Date
    Dec 2002
    Posts
    2,544
    Quote Originally Posted by Ken Fitlike
    http://cboard.cprogramming.com/showt...ght=IDC_STATIC

    When using windres (mingw windows resource compiler) always make sure your resource script has something like the following at the top:
    Code:
    #include <windows.h>
    #include "resource.h" /*resource header contains defines for YOUR controls*/
    #if !defined IDC_STATIC
    #define IDC_STATIC -1
    #endif
    When having trouble with compiler/tool errors it is usually helpful to post the exact error text.

  3. #3
    Registered User
    Join Date
    Nov 2004
    Posts
    18
    Ah, right - that extra text about the IDC_STATIC seems to have worked. Thanks.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Problem creating tmp file in /var/tmp
    By Rahulds in forum Linux Programming
    Replies: 1
    Last Post: 03-14-2009, 01:57 AM
  2. Problem with Creating File for File Processing
    By Dampecram in forum C Programming
    Replies: 2
    Last Post: 12-07-2008, 01:26 AM
  3. problem creating program to the specific specification
    By rushhour in forum C++ Programming
    Replies: 22
    Last Post: 11-28-2008, 12:15 AM
  4. Please Help - Problem with Compilers
    By toonlover in forum C++ Programming
    Replies: 5
    Last Post: 07-23-2005, 10:03 AM
  5. Replies: 3
    Last Post: 12-03-2001, 01:45 PM