Please explain a resource file
Moderator: Rathinagiri
Please explain a resource file
Dear Mentors
Cold you please explain what a resource file is, what it is for, how to use.
I see some .rc files in the SAMLPES but my Adobe reader cannot open them.
Thanks, I will await an explanation
Cold you please explain what a resource file is, what it is for, how to use.
I see some .rc files in the SAMLPES but my Adobe reader cannot open them.
Thanks, I will await an explanation
- dragancesu
- Posts: 921
- Joined: Mon Jun 24, 2013 11:53 am
- DBs Used: DBF, MySQL, Oracle
- Location: Subotica, Serbia
Re: Please explain a resource file
HMG program can load images from a folder or be embedded in the program
See demo1.prg and demo2.prg/demo2.rc
Look at demo2.rc and you will see a list of what compiler should be added to the program
Test is: make compile demo1 and demo2, than erase .bmp files and run
p.s. .rc is a simple txt file
attach is now correct, please download again,
See demo1.prg and demo2.prg/demo2.rc
Look at demo2.rc and you will see a list of what compiler should be added to the program
Test is: make compile demo1 and demo2, than erase .bmp files and run
p.s. .rc is a simple txt file
attach is now correct, please download again,
- Attachments
-
- rc.zip
- (20.27 KiB) Downloaded 221 times
Re: Please explain a resource file
Thanks, I see how things work.
I noticed that the rc file on my pc looks like an adobe acrobat file. However you have to open it with notepad et.al.
I noticed that the rc file on my pc looks like an adobe acrobat file. However you have to open it with notepad et.al.
Re: Please explain a resource file
Sorry, I don't see how things work after all
If I create a file myapp.rc with
IMAGE1 BITMAP IMAGE1.BMP
How odes the build process know about the .rc file.
Also, Does the rc file have to have the same name as the application?
Lastly, what types of resouces can be included besides BMP files
Thanks
If I create a file myapp.rc with
IMAGE1 BITMAP IMAGE1.BMP
How odes the build process know about the .rc file.
Also, Does the rc file have to have the same name as the application?
Lastly, what types of resouces can be included besides BMP files
Thanks
- esgici
- Posts: 4543
- Joined: Wed Jul 30, 2008 9:17 pm
- DBs Used: DBF
- Location: iskenderun / Turkiye
- Contact:
Re: Please explain a resource file
Please make a "search" before asking question
search.php?keywords=resouce+file&terms= ... mit=Search
Viva HMG
search.php?keywords=resouce+file&terms= ... mit=Search
Viva HMG
Viva INTERNATIONAL HMG
Re: Please explain a resource file
The examples have not helped
I create an rc file like myprog.rc , keeping it in the same folder as the myprog.prg file
containing a list of jpgs that I use in my program like
door jpg exitdoor.jpg
window jpg baywindow.jpg
then build the application again .
If I delete the jps and run the exe just built, the jpg images do not appear.
what am i doing wrong.
Thanks
I create an rc file like myprog.rc , keeping it in the same folder as the myprog.prg file
containing a list of jpgs that I use in my program like
door jpg exitdoor.jpg
window jpg baywindow.jpg
then build the application again .
If I delete the jps and run the exe just built, the jpg images do not appear.
what am i doing wrong.
Thanks
Re: Please explain a resource file
Do you refer to the jpg file name in the sources or to its resource name?
ex. PICTURE "door" or PICTURE "exitdoor.jpg" ?
Share piece of code with us.
ex. PICTURE "door" or PICTURE "exitdoor.jpg" ?
Share piece of code with us.
Last edited by edk on Wed Apr 11, 2018 6:45 pm, edited 2 times in total.
Re: Please explain a resource file
Sample...
// Using a resource file like this, you can include images,
// icons and sounds inside EXE.
//
// Resource name Resouce Type Resource FileName
// WAVERESNAME WAVE FILENAME.WAV
// Ejemplos:
//HMG JPG HMG.JPG
//imgBMP BITMAP img.BMP
//imgJPG JPG img.JPG
//imgGIF GIF img.GIF
//imgTIF TIF img.TIF
//imgPNG PNG img.PNG
//imgWMF WMF img.WMF
//imgICO ICO img.ICO
//imgCUR CUR img.CUR
// Using a resource file like this, you can include images,
// icons and sounds inside EXE.
//
// Resource name Resouce Type Resource FileName
// WAVERESNAME WAVE FILENAME.WAV
// Ejemplos:
//HMG JPG HMG.JPG
//imgBMP BITMAP img.BMP
//imgJPG JPG img.JPG
//imgGIF GIF img.GIF
//imgTIF TIF img.TIF
//imgPNG PNG img.PNG
//imgWMF WMF img.WMF
//imgICO ICO img.ICO
//imgCUR CUR img.CUR
Andrés González López
Desde Guadalajara, Jalisco. México.
Desde Guadalajara, Jalisco. México.
Re: Please explain a resource file
Thanks for all the patient replies but it ain't working for me. I have seen lots of examples in the forum and samples.
In my prg file there would be images referred to with the names like exitdoor.jpg and baywindow.jpg
The example. rc file would include: name, type, filename for each item, example of 2
door jpg exitdoor.jpg
window jpg baywindow.jpg
I used the same file name for the prg / hbp file and the resource file either in the same folder as the prg or in its own
sub-folder. Neither location worked.
I would then build the exe. How does the compiler know about and find the rc file? I don't know how.
It all sounds simple but some detail is missing in my knowledge of rc file use.
Thanks friends
In my prg file there would be images referred to with the names like exitdoor.jpg and baywindow.jpg
The example. rc file would include: name, type, filename for each item, example of 2
door jpg exitdoor.jpg
window jpg baywindow.jpg
I used the same file name for the prg / hbp file and the resource file either in the same folder as the prg or in its own
sub-folder. Neither location worked.
I would then build the exe. How does the compiler know about and find the rc file? I don't know how.
It all sounds simple but some detail is missing in my knowledge of rc file use.
Thanks friends
Re: Please explain a resource file
The compiler, when it finds a .rc file with the same name as .prg in the same folder, include the resources to the result file.
It is important to refer to the resource name in the sources, not to the jpg file. See an example from the attachment.
To check, is it jpg included into your .exe, just extract your .exe file (by 7-zip), and see folder: .rsrc\JPG, if doesn't exists "door" and "window" files, you do something wrong.