Page 1 of 2
How to Include bitmaps/icons in an EXE?
Posted: Mon Jan 10, 2011 3:24 pm
by karweru
Happy new year everyone,
The executable i'm producing doesn't display bitmaps/icons in the toolbar when i copy the executable into another folder or other computer. The bitmaps & icons i'm using are listed in the resources tab of the IDE, and show properly when I run from the project folder. My desire is to supply only one executable file.
I suspect i'm missing something, or is it that you have to supply the bitmaps/icon files together with the executable for it to work properly?
I'm using hmg3.
I would really appreciate some guidance please.
Re: How to Include bitmaps/icons in an EXE?
Posted: Mon Jan 10, 2011 4:34 pm
by Rathinagiri
Had you properly referenced with the reference name inside the control picture clause?
Re: How to Include bitmaps/icons in an EXE?
Posted: Mon Jan 10, 2011 9:31 pm
by Czarny_Pijar
Looks like the easiest way to accomplish this task is to substitute the file c:\hmg35\RESOURCES\window.ico to another one of your choice.
Re: How to Include bitmaps/icons in an EXE?
Posted: Tue Jan 11, 2011 5:49 am
by karweru
Thank you Rathi, cZarny,
I have made some further tests using samples\main.demo. Please compile it and copy the executable to another folder. When you run it from the ..\samples\main.demo folder, the printer and folder-open buttons show properly. When you run the executable in the other directory, the button images disappear. I hope this illustratrates my problem much better.
Re: How to Include bitmaps/icons in an EXE?
Posted: Tue Jan 11, 2011 6:20 am
by Rathinagiri
That is because the resource definition of main.demo doesn't include any image except demo.ico, br_no, br_ok.
All other images are specified by their file names! For instance, line no. 531
Re: How to Include bitmaps/icons in an EXE?
Posted: Tue Jan 11, 2011 7:08 am
by karweru
Dear Rathi,
Thanks for your response and patience.
I have edited the main demo resource file from the IDE to read as follows;
Code: Select all
br_no BITMAP br_no.bmp
br_ok BITMAP br_ok.bmp
demo ICON demo.ico
open BITMAP open.bmp
print BITMAP button.bmp
I'm still getting the same result.
Re: How to Include bitmaps/icons in an EXE?
Posted: Tue Jan 11, 2011 7:52 am
by Rathinagiri
Had you changed the reference in prg files too?
Re: How to Include bitmaps/icons in an EXE?
Posted: Tue Jan 11, 2011 9:03 am
by karweru
No Rathi, I haven't changed anything else...
Re: How to Include bitmaps/icons in an EXE?
Posted: Tue Jan 11, 2011 10:22 am
by Rathinagiri
That is the problem!
You have to specify the image reference only and not the filename in the .prg file.
Change #line 180 to
Like this, you have to refer the label given in resource file inside the prg file.
In your case, the exe file includes the resources, but since you refer the original filename, it searches for the file.
Re: How to Include bitmaps/icons in an EXE?
Posted: Tue Jan 11, 2011 1:42 pm
by mol
Try to use uppercase letters. I think it should help you...
Marek