NO

Author Topic: POIDE, Resource Editor  (Read 5479 times)

post from old forum

  • Guest
POIDE, Resource Editor
« on: September 14, 2004, 12:29:43 am »
Hi there !

Pellesc is definitely a great c compiler !
But I have some little problems with the resource editor.

1- when does it update the .h file ? it is often not synchronized
2- let's say I have a control that was named 1001, I name it IDC_CONTROl, then when I create a new control it takes the name 1001, and when I try to rename it to anything else, it says that 1001 is already assigned to another control (the IDC_CONTROL which was previously 1001)
3- I have a rc file in which I can't open any more a spefici dialog, it simply crash the resource editor, :

<code removed>

when I try to open then main dialog box (DLG_MAIN) the editor crash.

I hope I didn't break any rules, and did not repeat already asked questions.

thx for your answer !
Drakoh

post from old forum

  • Guest
POIDE, Resource Editor
« Reply #1 on: September 14, 2004, 12:30:08 am »
Hello!

>Pellesc is definitely a great c compiler !

Thanks!

>1- when does it update the .h file ? it is often not synchronized

The definitions should be updated immediately, and the symbol file (.h) should be saved when the resource script (.rc) is saved.

When you have loaded the resource script in the IDE, you can use View -> Resource includes... to check which symbol file is used, that is has a valid path, and so on.

>2- let's say I have a control that was named 1001, I name it
>IDC_CONTROl, then when I create a new control it takes the
>name 1001, and when I try to rename it to anything else, it
>says that 1001 is already assigned to another control (the
>IDC_CONTROL which was previously 1001)

Hmm... I can't really explain this. The generated ID for a new control should be unique - it is verified against the other controls in the current dialog. Since I sometimes need to map from ID to name, the ID numbers should be unique. To simplify this for the IDE, I try to keep the numbers in different groups:
1001-2000 (dialogs)
2001-3000 (menus)
3001-3500 (accelerator tables)
3501-4000 (accelerator items)
4001-6000 (dialog controls)
6001-8000 (menu items)
8000-10000 (bitmaps, icons, cursors, ...)
10000- (strings)

(You should be able to use other numbers too, but they might clash with these defaults, I guess...)

If you use View -> Resource symbols... you will see all your defined names and ID values. Maybe this will give a clue?

I know this part can be improved, but I'm not sure what is *best*. If you have any ideas, please let me know...

>3- I have a rc file in which I can't open any more a spefici
>dialog, it simply crash the resource editor, :

Sounds bad. I tried this on my Windows XP, but can't get a crash. I had to create main.h with the symbol definitions - maybe it's something in this file? If possible - can you attach both the resource script (.rc) and symbol file (.h) so I can test?

>I hope I didn't break any rules, and did not repeat already asked questions.

No problems! Just ask away...

Pelle

post from old forum

  • Guest
POIDE, Resource Editor
« Reply #2 on: September 14, 2004, 12:30:47 am »
Thx for your quick answer pelle !

1-Ok, I shall use the options you mentionned to check if everything is fine between my .rc and .h files.

2-What really happens with the 'already defined symbol' is in the case of 2 dialogs.
The symbol counter start back from 1001 for controls even if you already have some controls (1001,1002,1003) in the first dialog.
So when you try to rename that second 1001 control, it won't let you do it. I guess you will have to take in account all the resources in the .h file, and not only the one for the currently edited dialog.
Like a generic control id counter instead of a per dialog one.

3-I will attach the .h and .rc that make my IDE crash this evening when I'll be home.

4-Just a little remark, about the Windows CE compiler version, it looks like the function : ShellExecute, or ShellExecuteEx (don't quite remember) doesn't exist, is it normal ? Cause in the evc compiler it exists. Just for you to know !

Anyway keep up the good work !

Drakoh

post from old forum

  • Guest
POIDE, Resource Editor
« Reply #3 on: September 14, 2004, 12:31:25 am »
2. Something isn't working as it should - this is clear. I checked the code some more, and found out that not only do I verify that the new ID is unique within the current dialog, I also check that a symbol isn't using this ID number. This should be slightly better, but it can still fail. I have to think about a better solution.
3. Thanks.

4. Thanks for the info! I look at this. Hard to keep all definition up-to-date, especially since most request are for the 'standard' Windows part, not the Pocket PC part.

Pelle

post from old forum

  • Guest
POIDE, Resource Editor
« Reply #4 on: September 14, 2004, 12:32:15 am »
Here you go for the whole project so you can have all the same conditions as me.
<HTTP address removed>
Thx for your time !
PS: About the control id name problem, where do you check the already used id's ? is it in the h file, or in the memory ? maybe you have a little dis-synchronization between what you think you have in th .h file, and what is really in it ...
Have you tried yourself to create a dialog, to add a pushbutton (its id should be 1001), the rename it to IDC_BUT, then create a new dialog, add a new push button (it should be 1001 too), then try to rename it and you shall see what I am talking about.

Even worst, try to create a new project, a dialog based application, then go abd edit the dialog, try to rename the IDOK button, you won't be able, cause tis associated with the '1' value, and when you try to change its name, it's going to try to assign the true actual value of the control (1) to another name, and the IDE won't let you do this.
I think, before preventing the use of a specific ID, you should check if you're changing yourself. Just my 2 cents ^_^

Drakoh

post from old forum

  • Guest
POIDE, Resource Editor
« Reply #5 on: September 14, 2004, 12:32:45 am »
Thank you for the files!
As I understand it, you get the crash immediately when you open DLG_MAIN? I can't reproduce it here. Which Windows version are you using? Have you changed any settings that might apply?

All symbols *should* be cached in memory. I remember file positions to be able to modify the file as little as possible when saving (not rewriting the whole thing).

As I said before, I know this isn't working 100%. I have had problems myself, but usually when I'm busy with something else. When I have time to look at it, I have forgotten exactly what I did. With this information from you, I might be able to finally fix it. I will try and do something to the next release (2.90).

I will take a short vacation, and be back Aug 2. I have a plane to catch in about 12 hours. Need to get some sleep before that. I think we have to continue this when I get back...

Pelle