Author Topic: Resources & Manifests  (Read 4592 times)

Offline lmsmi1

  • Multiple posting newcomer
  • *
  • Posts: 11
Resources & Manifests
« on: November 26, 2012, 01:59:26 pm »
Okay, I don't understand. I have all files (main.cpp; main.xml; icon.ico; resources.rc) included in my project. For some reason it gives this message when attempting to compile:

Code
C:\Projects\WinServ\resources.rc|4|error: expected unqualified-id before numeric constant|

Here is the full resources.rc file:

Code
#define MAIN_ICON 220712

//this will set your .exe icon
MAIN_ICON ICON "icon.ico"

1 24 "main.xml"

//include version information in .exe, modify these values to match your needs
1 VERSIONINFO
FILEVERSION 0,1,1,1
PRODUCTVERSION 0,1,1,1
FILETYPE 0x00000001L
{
  BLOCK "StringFileInfo"
{
BLOCK "040904E4"
{
VALUE "CompanyName", "write version info here"
VALUE "FileVersion", "write version info here"
VALUE "FileDescription", "write version info here"
VALUE "InternalName", "write version info here"
VALUE "LegalCopyright", "write version info here"
VALUE "LegalTrademarks", "write version info here"
VALUE "OriginalFilename", "write version info here"
VALUE "ProductName", "write version info here"
VALUE "ProductVersion", "write version info here"
}
}
  BLOCK "VarFileInfo"
{
VALUE "Translation", 0x0409, 1252 //language codes
}
}

Now I've done trial and error, and this resource file is basically weaving in and out of each part. Suggestions?

zabzonk

  • Guest
Re: Resources & Manifests
« Reply #1 on: November 26, 2012, 02:30:43 pm »
At a guess, you are #including your .rc file in your C++ file(s) - you can't do that, as the C++ compiler will not understand the file's contents.

You need to  write  a resource.h file that contains the defines for your resources and include that in the .rc file and in the C++ files. Nothing should be including the .rc file, which needs to be processed by the resource compiler, not the C++ compiler. You also need to #include things like windows.h in the .rc file.

This has nothing particularly to do with C::B, by the way.

Offline lmsmi1

  • Multiple posting newcomer
  • *
  • Posts: 11
Re: Resources & Manifests
« Reply #2 on: November 26, 2012, 04:45:50 pm »
All right! Thanks. Now to find out how to change the BG color with HBRUSH from the standard grey one to a white one. ;D