Simple Tutorial - 15 : More Organization

General Help regarding HMG, Compilation, Linking, Samples

Moderator: Rathinagiri

franco
Posts: 183
Joined: Sat Nov 02, 2013 5:42 am
DBs Used: DBF
Been thanked: 6 times

Re: Simple Tutorial - 15 : More Organization

Post by franco » Mon Apr 17, 2017 4:00 pm

Anand, quick thought. My includes is empty.
my configuration says
inc=yes
head=native

my resources says
edit_new BITMAP edit_new.bmp
My_F1 BITMAP My_F1.bmp
my_f2 BITMAP my_f2.bmp
my_f3 BITMAP my_f3.bmp
my_f4 BITMAP my_f4.bmp
my_f5 BITMAP my_f5.bmp
my_f6 BITMAP my_f6.bmp
my_f7 BITMAP my_f7.bmp
my_f8 BITMAP my_f8.bmp
my_f9 BITMAP my_f9.bmp
my_f10 BITMAP my_f10.bmp
my_f11 BITMAP my_f11.bmp

does configuration need anything to do with resources

I tried the program you sent me with #include <hmg.ch> and put the above in the resources file.
I get error .....resource compiler can`t open bitmap file 'edit_new.bmp':-42 no such file or directory
it is in the the resources folder in the hmg3.2 folder

Franco
Last edited by franco on Mon Apr 17, 2017 4:09 pm, edited 1 time in total.

User avatar
serge_girard
Posts: 1729
Joined: Sun Nov 25, 2012 2:44 pm
DBs Used: 1 MySQL - MariaDB
2 DBF
Location: Belgium
Has thanked: 218 times
Been thanked: 39 times
Contact:

Post by serge_girard » Mon Apr 17, 2017 5:22 pm

Franco, I think somewhere there is a file missing, check it all!

Serge

User avatar
mol
Posts: 2742
Joined: Thu Sep 11, 2008 5:31 am
Location: Myszków, Poland
Has thanked: 91 times
Been thanked: 32 times
Contact:

Post by mol » Mon Apr 17, 2017 6:28 pm

Put all filenames and resources i n capital letters.
Maybe it will help

edk
Posts: 103
Joined: Thu Oct 16, 2014 11:35 am
Location: Poland
Has thanked: 24 times
Been thanked: 44 times

Post by edk » Mon Apr 17, 2017 8:29 pm

franco wrote:
Mon Apr 17, 2017 8:28 am
Thanks Anand, I still can not get it to work for me.
I built my own f.bmp`s and put them in the hmg 3.2 resources folder. Then entered there names as you suggested in my resource area of my program. (...)
franco wrote:
Mon Apr 17, 2017 4:00 pm
my resources says I
edit_new BITMAP edit_new.bmp
My_F1 BITMAP My_F1.bmp
my_f2 BITMAP my_f2.bmp
my_f3 BITMAP my_f3.bmp
my_f4 BITMAP my_f4.bmp
my_f5 BITMAP my_f5.bmp
my_f6 BITMAP my_f6.bmp
my_f7 BITMAP my_f7.bmp
my_f8 BITMAP my_f8.bmp
my_f9 BITMAP my_f9.bmp
my_f10 BITMAP my_f10.bmp
my_f11 BITMAP my_f11.bmp
Try copy all .bmp files into your project folder, the same as .prg file (files), then compile.
Or copy into subfolder ex. "res" and edit resource file like this

Code: Select all

   
edit_new   BITMAP  res\edit_new.bmp
My_F1      BITMAP  res\My_F1.bmp
my_f2      BITMAP  res\my_f2.bmp
my_f3      BITMAP  res\my_f3.bmp
my_f4      BITMAP  res\my_f4.bmp
my_f5      BITMAP  res\my_f5.bmp
my_f6      BITMAP  res\my_f6.bmp
my_f7      BITMAP  res\my_f7.bmp
my_f8      BITMAP  res\my_f8.bmp
my_f9      BITMAP  res\my_f9.bmp
my_f10      BITMAP  res\my_f10.bmp
my_f11      BITMAP  res\my_f11.bmp
   
Also as PICTURE property you must use resource name, not file name, for example

Code: Select all

PICTURE "edit_new"
not

Code: Select all

PICTURE "edit_new.bmp"
Edward.

franco
Posts: 183
Joined: Sat Nov 02, 2013 5:42 am
DBs Used: DBF
Been thanked: 6 times

Post by franco » Tue Apr 18, 2017 6:43 am

Thank You edk, I have it working as you suggested. I put any bitmaps in my program folder and set as you said Picture "edit_new".
This works, but it would be nice to use the hmg resources.
Here is the error I get if the bmp is not in my program folder. I do not know how to set the bmp path to hmg.3.2\resources
My program folder is c:\hmg3\grtest
hbmk2: Linking... grtest.exe
gcc.exe: error: C:/hmg3/grtest/_temp.o: No such file or directory
Thanks again to all ......................Franco

edk
Posts: 103
Joined: Thu Oct 16, 2014 11:35 am
Location: Poland
Has thanked: 24 times
Been thanked: 44 times

Post by edk » Tue Apr 18, 2017 7:25 am

The path to bmp files you should set into grtest.rc file, ex:

Code: Select all

edit_new   BITMAP  c:\hmg.3.2\resources\edit_new.bmp
My_F1      BITMAP  c:\hmg.3.2\resources\My_F1.bmp
my_f2      BITMAP  c:\hmg.3.2\resources\my_f2.bmp
my_f3      BITMAP  c:\hmg.3.2\resources\my_f3.bmp
my_f4      BITMAP  c:\hmg.3.2\resources\my_f4.bmp
my_f5      BITMAP  c:\hmg.3.2\resources\my_f5.bmp
my_f6      BITMAP  c:\hmg.3.2\resources\my_f6.bmp
my_f7      BITMAP  c:\hmg.3.2\resources\my_f7.bmp
my_f8      BITMAP  c:\hmg.3.2\resources\my_f8.bmp
my_f9      BITMAP  c:\hmg.3.2\resources\my_f9.bmp
my_f10      BITMAP  c:\hmg.3.2\resources\my_f10.bmp
my_f11      BITMAP  c:\hmg.3.2\resources\my_f11.bmp
To check, is it bmp included into your grtest.exe, just extract your grtest.exe file (by 7-zip), and see folder: .rsrc\BITMAP, if doesn't exist edit_new.bmp file you do something wrong.
Bez tytułu.png
Bez tytułu.png (62.31 KiB) Viewed 269 times
By the way, in my opinion, better use PNG instead of BMP files.
Then the grtest.rc file should look like this:

Code: Select all

edit_new   PNG  c:\hmg.3.2\resources\edit_new.png
My_F1      PNG  c:\hmg.3.2\resources\My_F1.png
my_f2      PNG  c:\hmg.3.2\resources\my_f2.png
my_f3      PNG  c:\hmg.3.2\resources\my_f3.png
my_f4      PNG  c:\hmg.3.2\resources\my_f4.png
my_f5      PNG  c:\hmg.3.2\resources\my_f5.png
my_f6      PNG  c:\hmg.3.2\resources\my_f6.png
my_f7      PNG  c:\hmg.3.2\resources\my_f7.png
my_f8      PNG  c:\hmg.3.2\resources\my_f8.png
my_f9      PNG  c:\hmg.3.2\resources\my_f9.png
my_f10      PNG  c:\hmg.3.2\resources\my_f10.png
my_f11      PNG  c:\hmg.3.2\resources\my_f11.png

User avatar
Anand
Posts: 168
Joined: Tue May 24, 2016 4:36 pm
DBs Used: DBF
Has thanked: 14 times
Been thanked: 28 times

Post by Anand » Tue Apr 18, 2017 11:00 am

Hi Franco,

Hope your problem is solved from all the guidance you already got :D , the beauty of HMG.

Regards,

Anand
Image

franco
Posts: 183
Joined: Sat Nov 02, 2013 5:42 am
DBs Used: DBF
Been thanked: 6 times

Post by franco » Tue Apr 18, 2017 4:16 pm

I wish to thank all who participated in my problem. Most problems become very simple in the end.
In going through this I noticed there is a stable 3.3. The reason I used 3.2 is it showed stable in download folder.
The 3.3 looks like it has a lot more to it. Is it stable ? and do you think I should change to it. I do not want any problems for my business clients.
Thanks again ..................... Franco :D

User avatar
serge_girard
Posts: 1729
Joined: Sun Nov 25, 2012 2:44 pm
DBs Used: 1 MySQL - MariaDB
2 DBF
Location: Belgium
Has thanked: 218 times
Been thanked: 39 times
Contact:

Post by serge_girard » Wed Apr 19, 2017 8:01 am

Franco,

See also this topic with Button.prg , thanks to Pablo :

http://hmgforum.com/viewtopic.php?f=14&t=5128

Serge

franco
Posts: 183
Joined: Sat Nov 02, 2013 5:42 am
DBs Used: DBF
Been thanked: 6 times

Post by franco » Wed Apr 19, 2017 8:21 am

Thanks Serge,
This very interesting and could be useful in the future.
Franco

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest