Thread: Resources with Dev C++ Problem (many simple problems)

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

    Resources with Dev C++ Problem (many simple problems)

    Ok, i keep running into dead end after another with this resource file / defining.

    Can someone give me some tips? Between the resource file format, not knowing what exactly i have to #define in the resource file, and that anytime i make progress Dev C++ just says i have a "Syntax Error" and thats it, which helps me none because the syntax is directly from the tutorial i am taking.

    I have attached the Dev C++ Project and the Resource files, but for those who dont have Dev C++ or dont wanna dl, ect.., here is the resource file.
    Code:
    #include "resources.h"
    
    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
    Keep in mind that i'm not too aware of what i need to define and what already is, ect.. And would appreciate advice on that too.


    Big Thanks to anyone who can dl and view my stuff, and tell me the hundred things i'm doing wrong. I was doing fine until i had to add the resource files, then the problems began. First DevC++ started given me junk about Untitled2.rc (which was the rc name it gave me before i saved it with a new name), and blahblah. I "think" i fixed that, but anyway, help this n00b lol

    (FYI, i'm taking "the Forgers" tutorial which you can see via the dialog resource.)


    *edit*
    i cant attach RC, .DEV, nor the .Zip that contained them all. So im using my host.
    http://zeuslogic.gvale.com/Windows%2001.zip

    But none the less my cpp and headers are included.
    01110111011000010110110001100100011011110010000001 11000101110101011010010111010000100000011011000110 10010110011001100101001000000111100101101111011101 0100100000011011100111010101100010

  2. #2
    Sweet
    Join Date
    Aug 2002
    Location
    Tucson, Arizona
    Posts
    1,820
    change IDC_STATIC to -1 and include windows.h and you're good
    Last edited by prog-bman; 04-06-2005 at 11:09 PM.
    Woop?

  3. #3
    #junkie
    Join Date
    Oct 2004
    Posts
    240
    Can you explain "change" i tried Replacing IDC_STATIC with "-1" that didnt seem to work, and i tried defining it in the header file, that didnt seem to work..

    The following errors at the moment are (with static not "changed", though even when i tried both of them the errors were the same)
    Code:
    2 C:\Path\main.cpp In file included from main.cpp 
    4 C:\Path\dialog.rc expected unqualified-id before numeric constant 
    4 C:\Path\dialog.rc expected `,' or `;' before numeric constant 
     C:\Path\main.cpp In function `int WinMain(HINSTANCE__*, HINSTANCE__*, CHAR*, int)': 
    23 C:\Path\main.cpp `WindowProcedure' undeclared (first use this function) 
      (Each undeclared identifier is reported only once for each function it appears in.) 
     C:\Path\main.cpp In function `LRESULT WindowProcedure(HWND__*, UINT, WPARAM, LPARAM)': 
    65 C:\Path\main.cpp `LRESULT WindowProcedure(HWND__*, UINT, WPARAM, LPARAM)' used prior to declaration 
     C:\Path\Makefile.win [Build Error]  [main.o] Error 1
    (Note that if i remove the existance of all that dialog resource header junk everything works.)
    01110111011000010110110001100100011011110010000001 11000101110101011010010111010000100000011011000110 10010110011001100101001000000111100101101111011101 0100100000011011100111010101100010

  4. #4
    Registered User
    Join Date
    Sep 2001
    Posts
    4,912
    Moved to the Windows Programming Forum

  5. #5
    Sweet
    Join Date
    Aug 2002
    Location
    Tucson, Arizona
    Posts
    1,820
    Ok now that I looked at your source file I see your problem.
    You don't include rc files in c/c++ files they are compiled as well so you just need to change this
    Code:
    #include <windows.h>
    #include "dialog.rc"
    To:
    Code:
    #include <windows.h>
    #include "resources.h"
    And you will be good to go.
    Woop?

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Resources problem
    By Garland in forum Windows Programming
    Replies: 2
    Last Post: 09-08-2007, 02:46 PM
  2. Resources in Dev C++
    By JJFMJR in forum Windows Programming
    Replies: 7
    Last Post: 08-27-2007, 05:14 AM
  3. Replies: 5
    Last Post: 12-03-2003, 05:47 PM
  4. Im a Newbie with a graphics design problem for my simple game
    By Robert_Ingleby in forum C++ Programming
    Replies: 1
    Last Post: 11-23-2001, 06:41 PM
  5. A Simple (?) Problem
    By Unregistered in forum C++ Programming
    Replies: 8
    Last Post: 10-12-2001, 04:28 AM