User forums > Using Code::Blocks

Resource File Errors

(1/2) > >>

slippnslide:
This is the resource script I'm using:

--- Code: ---503 DIALOG 10, 26, 235, 50
STYLE DS_MODALFRAME | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU
CAPTION "Window Title"
LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
FONT 8, "MS Shell Dlg"
{
   CONTROL "Test line of text", -1, STATIC, SS_LEFT | WS_CHILD | WS_VISIBLE, 15, 12, 165, 8
   CONTROL "Enter #", -1, STATIC, SS_LEFT | WS_CHILD | WS_VISIBLE | WS_GROUP, 15, 27, 70, 8
   CONTROL "", 201, EDIT, ES_LEFT | ES_AUTOHSCROLL | WS_CHILD | WS_VISIBLE | WS_BORDER | WS_TABSTOP, 95, 25, 65, 12
   CONTROL "OK", 1, BUTTON, BS_DEFPUSHBUTTON | WS_CHILD | WS_VISIBLE | WS_TABSTOP, 176, 7, 50, 14
   CONTROL "Quit", 2, BUTTON, BS_PUSHBUTTON | WS_CHILD | WS_VISIBLE | WS_TABSTOP, 176, 24, 50, 14
}[/quit]
When I compile this with MinGW, I keep getting errors in the script.  Does anyone see what's wrong with it or how to get it to work?  So far, the only thing I've gotton to work resource-related is icons.
--- End code ---

sethjackson:

--- Quote from: slippnslide on July 25, 2006, 12:04:39 am ---This is the resource script I'm using:

--- Code: ---503 DIALOG 10, 26, 235, 50
STYLE DS_MODALFRAME | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU
CAPTION "Window Title"
LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
FONT 8, "MS Shell Dlg"
{
   CONTROL "Test line of text", -1, STATIC, SS_LEFT | WS_CHILD | WS_VISIBLE, 15, 12, 165, 8
   CONTROL "Enter #", -1, STATIC, SS_LEFT | WS_CHILD | WS_VISIBLE | WS_GROUP, 15, 27, 70, 8
   CONTROL "", 201, EDIT, ES_LEFT | ES_AUTOHSCROLL | WS_CHILD | WS_VISIBLE | WS_BORDER | WS_TABSTOP, 95, 25, 65, 12
   CONTROL "OK", 1, BUTTON, BS_DEFPUSHBUTTON | WS_CHILD | WS_VISIBLE | WS_TABSTOP, 176, 7, 50, 14
   CONTROL "Quit", 2, BUTTON, BS_PUSHBUTTON | WS_CHILD | WS_VISIBLE | WS_TABSTOP, 176, 24, 50, 14
}
--- End code ---
When I compile this with MinGW, I keep getting errors in the script.  Does anyone see what's wrong with it or how to get it to work?  So far, the only thing I've gotton to work resource-related is icons.

--- End quote ---

What are the errors you get with MinGW?

slippnslide:
None.  The resource compiler is giving me the errors.  It isn't very specific.  It says there's an error on line 7.  I delete line 7 and re-build.  Same error until I end up deleting the whole script.

sethjackson:

--- Quote from: slippnslide on July 25, 2006, 02:37:09 am ---None.  The resource compiler is giving me the errors.  It isn't very specific.  It says there's an error on line 7.  I delete line 7 and re-build.  Same error until I end up deleting the whole script.

--- End quote ---

Ok. I think it is because CONTROL isn't defined. :)

slippnslide:
Whoops, I should point out that this is my complete .rc file.  So, line 7 points to the "STYLE" line.


--- Code: ---#include "resource.h"

IDI_MYICON ICON "icon.ico"


503 DIALOG 10, 26, 235, 50
STYLE DS_MODALFRAME | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU
CAPTION "Window Title"
LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
FONT 8, "MS Shell Dlg"
{
   CONTROL "Test line of text", -1, STATIC, SS_LEFT | WS_CHILD | WS_VISIBLE, 15, 12, 165, 8
   CONTROL "Enter #", -1, STATIC, SS_LEFT | WS_CHILD | WS_VISIBLE | WS_GROUP, 15, 27, 70, 8
   CONTROL "", 201, EDIT, ES_LEFT | ES_AUTOHSCROLL | WS_CHILD | WS_VISIBLE | WS_BORDER | WS_TABSTOP, 95, 25, 65, 12
   CONTROL "OK", 1, BUTTON, BS_DEFPUSHBUTTON | WS_CHILD | WS_VISIBLE | WS_TABSTOP, 176, 7, 50, 14
   CONTROL "Quit", 2, BUTTON, BS_PUSHBUTTON | WS_CHILD | WS_VISIBLE | WS_TABSTOP, 176, 24, 50, 14
}
--- End code ---

Navigation

[0] Message Index

[#] Next page

Go to full version