NO

Author Topic: Resource Editor in Pelles C IDE - cannot parse its own *.rc file  (Read 3734 times)

mindrock

  • Guest
Resource Editor in Pelles C IDE cannot open the *.rc file it just has saved. To be correct - it's being opened as a plain text instead of being opened in Resource Editor.

Steps:

1. File -> New Project -> Pocket PC Application Wizard
2. Typing Project Name and path -> then press OK
3. App Name - any, Type of Pocket PC application - A "Hello, world" program.
4. Next -> needed files are being created -> Finish.

right here I copied *.rc file that has been created to different folder for examination purposes

5. Double Click at *.rc file in the Project Tree -> Resource Editor opens the file properly.
7. Save All button inside IDE becomes active.
8. Click Save All button
9. Close *.rc file (please note - no changes have been made)
10. Double Click at the same *.rc file again - now it opens as a plain text.  :(

Now I've compared two files - actual *.rc file and the copy of it that I made recently after step 4 and below are the differences:

1. Saved copy (that is working) has at line 1:
//RESOURCE SCRIPT generated by "Pelles C for Windows, version 1.00".
Actual file has there:
// RESOURCE SCRIPT generated by "Pelles C for Windows, version 5.00".

2. All BEGIN and END statements have been replaced in the new file with brackets { and } accordingly.

3. #include <richedit.h> has been added to the new file.

4. This one:

IDR_MNU_MAIN RCDATA
BEGIN
  IDR_MNU_MAIN, 1
  (-2), IDM_ABOUT, 4, 24, IDS_ABOUT, 0, 0
END


is replaced with this one:

IDR_MNU_MAIN SHMENUBAR
{
  IDR_MNU_MAIN, 1
  I_IMAGENONE, IDM_ABOUT, 0|TBSTATE_ENABLED, TBSTYLE_BUTTON|TBSTYLE_DROPDOWN|TBSTYLE_AUTOSIZE, IDS_ABOUT, 0, 0
}


Modified:

Yesterday I found an error that Resource Editor reports. It cannot find symbol I_IMAGENONE that is present in the *.rc file mentioned above. This symbol is defined in <commctrl.h>  at line 819, but its definition needs symbol UNDER_CE to be defined beforehand. Symbol UNDER_CE becomes defined in <windows.h> in case if _WINCE symbol is defined. As we can see in Project Settings, _WINCE is defined (!) and this is why the project can be still compiled and built without any errors.

I tried to define _WINCE directly in *.rc file, but this doesn't work, as well as if I define this in any other place... :o

BUT! If I put this:

#define _WINCE

right in <windows.h> (that is in Include\WinCE folder) at Line 1 - everything begin to work!!!! Resource Editor is happy!  ;D
Compiler tells me that I've redefined _WINCE when I try to build the project, but this is not important  ;)

Well, dear Pelle, please find out why Resource Editor doesn't take _WINCE symbol definition into account if it's defined outside of <windows.h>???
« Last Edit: April 05, 2009, 01:58:53 PM by mindrock »

Offline Pelle

  • Administrator
  • Member
  • *****
  • Posts: 2266
    • http://www.smorgasbordet.com
Re: Resource Editor in Pelles C IDE - cannot parse its own *.rc file
« Reply #1 on: April 21, 2009, 04:19:26 PM »
1) I can't reproduce the "opens as a plain text" after Save All - it works fine here.

2) Yes, _WINCE must be defined for a Windows Mobile project - and this symbol is defined for both empty and wizard generated projects; see "Project options", compiler and resource compiler tabs. Always including windows.h is the best way of getting the proper definitions; "randomly" picking some other include file may not work for Windows mobile, as well as desktop Windows.

/Pelle

mindrock

  • Guest
Re: Resource Editor in Pelles C IDE - cannot parse its own *.rc file
« Reply #2 on: April 23, 2009, 08:25:30 AM »
I have this issue both at my home workstation and at my workplace, thus, there are two totally independent setups. Both machines are running under Windows XP Pro 32bit. The steps I described are correct. Are you sure you tested this behavior at non-modified version 5.00.8?

Offline Pelle

  • Administrator
  • Member
  • *****
  • Posts: 2266
    • http://www.smorgasbordet.com
Re: Resource Editor in Pelles C IDE - cannot parse its own *.rc file
« Reply #3 on: April 23, 2009, 03:10:18 PM »
Yes.

EDIT: OK, I have tried your steps multiple times. Apparently their is a "random" factor involved somewhere. I can repeat your problem once in a while, so at least i'ts not zero times anymore... I will bug-hunt...
« Last Edit: April 23, 2009, 05:41:54 PM by Pelle »
/Pelle