Pelles C problem

All announcements, questions and issues related to the Resource Builder
Post Reply
noman9607
Posts: 4
Joined: Thu Jan 03, 2008 2:56 am

Pelles C problem

Post by noman9607 »

I am having a little problem using RB with Pelles C and the rc format.
The problem is just a few lines at the top of the .rc file.
Maybe an example is easier:

from Pelles:
// RESOURCE SCRIPT generated by "Pelles C for Windows, version 1.00".

#include <windows.h>
#include <commctrl.h>
#include "main.h"

LANGUAGE LANG_ENGLISH,SUBLANG_ENGLISH_US
(the rest is no problem)

now from Resource Builder:
/*********************************************
File: C:\DOCUMENTS AND SETTINGS\P\MY DOCUMENTS\_PROJECTS\C\001_LEARNING_C\FRED\MAIN.RC
Generated by Resource Builder (2.6.4.1).
*********************************************/
/*
OutputExt=res
*/
8001 ICON
MOVEABLE IMPURE LOADONCALL DISCARDABLE
LANGUAGE LANG_ENGLISH, 1
(the rest is no problem)

I can import the .rc file into RB because RB is smart enough to let me "edit as text" then I just comment out the "#include . . ." lines.
The other small differences in the lines starting with "moveable" and "language" don't seem to bother the Pelles compiler.
The trouble is that RB strips those lines on save or export then the IDE can't display the resources because it expects the "#include . . ." lines.
I can't edit the rc file as text in Pelles because it cannot display a rc file as text. I have to start another text editor, add the missing include lines, save the file, close the editor and start the Pelles IDE again.

Can RB be modified to respect the commented lines on import and NOT STRIP those lines on export? If RB would give me the option of "edit as text" on export (then un-comment the #include lines) as well as import it would save me a lot of bother. I think you could do this with an option checkbox in project properties perhaps.
Resource Builder has come a long way since the earlier days when I bought it (and it used to cost twice as much then!) I find it to be a great way to seperate the GUI from the program logic in WIN32 SDK programming. I especially like the ability to open an .exe file and make changes or 'borrow' a resource.
Happy New Year from North Carolina
isiticov
Site Admin
Posts: 2383
Joined: Thu Nov 21, 2002 3:17 pm

Post by isiticov »

Hello,

If you make Resource Builder able to access these files mentioned in #include (by adjusting compiler path settings) then it (RB) will allow you to keep these #include at the top of file without commenting them out. And later after exporting RC from Resource Builder it will add these #include at the top of file.
Please let me know if this helps.
Best regards,
Igor Siticov.
noman9607
Posts: 4
Joined: Thu Jan 03, 2008 2:56 am

not much help

Post by noman9607 »

The path for main.h changes for every project and even for debug and release versions. The help file is confusing for it states that the "Include directories" are browsed while compiling scripts with#include filename directives but I don't want RB to browse those directories, I want the strings left alone. It is my compiler that needs them, not RB. RB works perfectly well when they are not there at all.

In any case I put all three path-filenames into the listbox "Include Directories" and I have the same problem.

thanks,
isiticov
Site Admin
Posts: 2383
Joined: Thu Nov 21, 2002 3:17 pm

Post by isiticov »

RB compiles RC scripts upon opening them. Does RB asks you about include files after you save RC in it?
Best regards,
Igor Siticov.
noman9607
Posts: 4
Joined: Thu Jan 03, 2008 2:56 am

Post by noman9607 »

Here is the message I get:

Error ID: 116

Error message: File C:\Program Files\PellesC\Include\Win\commctrl.h. Line 51 : 116. Number expected but got __POCC__ in expression

I find it very odd that RB is scanning a file it does not need, then reporting an error for doing so. Remember that RB works fine if the lines are commented or not there in the first place (I erase them). It is my C compiler which needs the #includes as I am sure you well know.

thanks, I am sure we will figure out something.
isiticov
Site Admin
Posts: 2383
Joined: Thu Nov 21, 2002 3:17 pm

Post by isiticov »

The easiest workaround for this I could suggest is to create empty! .h files and place them into the same folder as this RC or "somewhere" and add this "somewhere" to Include Path for compiler. Then RB will "use" these empty .H files and later on saving add reference to them at the top of the file.
Best regards,
Igor Siticov.
Post Reply