Thread: Dialog Box (Compile Problem)

  1. #1
    i dont know Vicious's Avatar
    Join Date
    May 2002
    Posts
    1,200

    Dialog Box (Compile Problem)

    I have an odd problem.
    I have searched the boards and google to no avail.

    I have created a Dialog Box, which works fine. I want to add text to the Dialog Box, but when I add the line of code to do so, I get some errors.

    Here is what I've got.

    Code:
    IDD_ROM_INFO DIALOG 0, 0, 200, 200
    STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
    CAPTION "Rom Info"
    FONT 8, "MS Sans Serif"
    {
        
        DEFPUSHBUTTON "OK", IDOK, 50, 185, 100, 10
        CTEXT         "Rom Name:", IDC_STATIC, 16, 18, 9, 33
        
    }
    It gives me a "parse error" on the CTEXT line.

    I have included "resource.h" and <windows.h> in the resource file.

    I am thinking that IDC_STATIC is not being defined, but I dont know what header it is supposed to be in.

    I am using Dev-C++ 4.9.9.0

  2. #2
    Software Developer jverkoey's Avatar
    Join Date
    Feb 2003
    Location
    New York
    Posts
    1,905
    IDC_STATIC is usually defined as -1 i believe in resource.h

    -edit-
    just did a search and found it defined in afxres.h
    Last edited by jverkoey; 08-31-2004 at 12:02 AM.

  3. #3
    i dont know Vicious's Avatar
    Join Date
    May 2002
    Posts
    1,200
    Oh, thank you.

    That problem has been bugging me for months.

    EDIT:
    To your EDIT:

    Ah, no wonder...
    Thats a MSVC++ thing isnt it...

  4. #4
    erstwhile
    Join Date
    Jan 2002
    Posts
    2,227
    >>Thats a MSVC++ thing isnt it...<<

    Not necessarily...

    A dummy afxres.h has been part of MinGW for at at least 6 months which defines IDC_STATIC; I believe it was added to make it easier to compile msvc designed code. It's part of win32api v2.5 and therefore of MinGW 3.4 candidate - and DevCpp 4.9.9.0.
    CProgramming FAQ
    Caution: this person may be a carrier of the misinformation virus.

  5. #5
    i dont know Vicious's Avatar
    Join Date
    May 2002
    Posts
    1,200
    On a related note,

    How would I go about printing a hex value to an edit control.

    I have tried using SetDlgItemText but I cant figure out how to make it a hex value (or number for that matter).

  6. #6
    C++ Developer XSquared's Avatar
    Join Date
    Jun 2002
    Location
    Ontario, Canada
    Posts
    2,718
    Use sprintf() to format a string, and then pass that to SetDlgItemText.
    Naturally I didn't feel inspired enough to read all the links for you, since I already slaved away for long hours under a blistering sun pressing the search button after typing four whole words! - Quzah

    You. Fetch me my copy of the Wall Street Journal. You two, fight to the death - Stewie

  7. #7
    i dont know Vicious's Avatar
    Join Date
    May 2002
    Posts
    1,200
    Ah, jeez.. I would forget I have a left foot if I didnt have to walk on it..

    Thank you!

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Dialog Box error
    By JJFMJR in forum Windows Programming
    Replies: 4
    Last Post: 09-04-2007, 07:51 AM
  2. Parent of a BrowseForFolder dialog box
    By @nthony in forum Windows Programming
    Replies: 4
    Last Post: 01-08-2007, 02:54 PM
  3. Display Dialog Box Then Execute
    By stickman in forum C++ Programming
    Replies: 17
    Last Post: 05-10-2006, 11:02 AM
  4. Resize Dialog Box via Code :: MFC
    By kuphryn in forum Windows Programming
    Replies: 2
    Last Post: 10-27-2002, 11:00 PM
  5. Dialog Box Problem....
    By minime6696 in forum Windows Programming
    Replies: 2
    Last Post: 01-08-2002, 08:24 PM