NO

Author Topic: A bug in the resource compiler?  (Read 5101 times)

DiVVo

  • Guest
A bug in the resource compiler?
« on: February 02, 2010, 12:32:55 PM »
Pelles C for Windows 6.00.4, just installed.

The "Hello World"-project generated by the wizard.

I have changed some lines, such as:

in main.c:
.................................................
    wc.hIcon = LoadIcon(ghInstance, MAKEINTRESOURCE(IDR_ICO_MONUJO));
.................................................
in main.h:
.................................................
#define IDR_ICO_MONUJO  8001
#define IDR_ICO_MAIN  8002
.................................................
in main.rc:
.................................................
IDR_ICO_MONUJO ICON "monujo.ico"

IDR_ICO_MAIN ICON "main.ico"
.................................................

Then I have built the project and going to make a link file to the program. I click the "change icon" button and see TWO "C-Ball" pictures. Then I copy monujo.ico into main.ico, rebuild the project and see... Guess what? Right, the same two C-Ball pictures.

It seems to me, the resource compiler assignes to any icon recources the C-Ball picture. Is this a bug, or a feachure? If a bug, how to fix it?

Offline AlexN

  • Global Moderator
  • Member
  • *****
  • Posts: 394
    • Alex's Link Sammlung
Re: A bug in the resource compiler?
« Reply #1 on: February 02, 2010, 03:49:15 PM »
Perhaps your icons have an older time stamp as your .res-file. Then the make sees no reason  to build a new resource binary file. Try to build the hole project and you will find your icons. ;)
best regards
 Alex ;)

DiVVo

  • Guest
Re: A bug in the resource compiler?
« Reply #2 on: February 03, 2010, 02:05:43 PM »
Perhaps your icons have an older time stamp as your .res-file. Then the make sees no reason  to build a new resource binary file. Try to build the hole project and you will find your icons. ;)

Not so simple. Really, the bug is not in the compiler, it's in the built-in graphic editor.

Example: Open the file "main.ico", paint something, and then execute "File" - "Save As" - name - "Save". See the new icon with another viewer - it's the C-Ball! Then start the IDE, click "open" and open the icon file - you see your self-made picture! Isn't funny?  ;D

Offline AlexN

  • Global Moderator
  • Member
  • *****
  • Posts: 394
    • Alex's Link Sammlung
Re: A bug in the resource compiler?
« Reply #3 on: February 03, 2010, 03:28:32 PM »
Not so simple, but nearly so simple (I think).

If you look at the bar over the graphic, you will see that the C-ball icon has many formats. If you change only the graphic of one, you have a good probability that you still see the C-ball.

I would recommend you to change the formats you want to change and delete the others.
best regards
 Alex ;)

DiVVo

  • Guest
Re: A bug in the resource compiler?
« Reply #4 on: February 04, 2010, 08:31:35 PM »
If you look at the bar over the graphic, you will see that the C-ball icon has many formats. If you change only the graphic of one, you have a good probability that you still see the C-ball.

Yes, you are right. I have forgotten this feature of icon files, vae to me.  :-[

Thank you very much! It was nice of you to bear quietly my misunderstanding. :D

But actually it is a bad feature of the editor, to show the current shape only at the left bar, and to hide the other included pictures. More useful would be to show all of them at once, and to use the left bar as an additional switcher between the pictures included in the icon file (as it was made in the IcoFX editor, see http://icofx.ro). And clicking with the right button should call the context menu...  O, dreams. ::)

One question more, if you wouldn't mind. I can make various formats of the icon and copy pictures from one to another - with the same size. And I haven't found any resizing function for a icon picture - for a bmp image only. Well, I can paste the image into a bmp picture, resize it and copy back into a bigger icon... But it is something ugly, "a shaman dance with a tambourine" as one used to name it.  ;)   Isn't there more straight way? It would be great, if you told me.
« Last Edit: February 04, 2010, 08:34:47 PM by DiVVo »

Offline AlexN

  • Global Moderator
  • Member
  • *****
  • Posts: 394
    • Alex's Link Sammlung
Re: A bug in the resource compiler?
« Reply #5 on: February 05, 2010, 08:04:15 AM »

But actually it is a bad feature of the editor, to show the current shape only at the left bar, and to hide the other included pictures. More useful would be to show all of them at once, and to use the left bar as an additional switcher between the pictures included in the icon file (as it was made in the IcoFX editor, see http://icofx.ro). And clicking with the right button should call the context menu...  O, dreams. Roll Eyes

One question more, if you wouldn't mind. I can make various formats of the icon and copy pictures from one to another - with the same size. And I haven't found any resizing function for a icon picture - for a bmp image only. Well, I can paste the image into a bmp picture, resize it and copy back into a bigger icon... But it is something ugly, "a shaman dance with a tambourine" as one used to name it.  ;)   Isn't there more straight way? It would be great, if you told me.

I don't know a better way with the editor of Pelles C. But if you are familiar with IcoFX (or any other icon-editor), create your icons with that.
best regards
 Alex ;)