HMG 3.0.36 (Test 2011-03-22)

HMG announcements; Latest HMG-related news, releases, fixes and updates.

Moderator: Rathinagiri

Ricci
Posts: 255
Joined: Thu Nov 19, 2009 2:23 pm

Re: HMG 3.0.36 (Test 2011-03-22)

Post by Ricci »

l3whmg wrote:But I have a question for you: when I create my programs, I add my images and for this reason I must compile resource file.
As Rathinagiri wrote in the other thread it is enough to put the resource file name in your project.hbp file.

l3whmg wrote:Adding the file hmg.o to the hmg.hbc, is there some risk (ie duplicating the images distributed by HMG)?
I lost all of my icons in the rc-file.

It´s getting worse ;)
Attachments
hmg36.jpg
hmg36.jpg (183.13 KiB) Viewed 4964 times
User avatar
gfilatov
Posts: 1067
Joined: Fri Aug 01, 2008 5:42 am
Location: Ukraine
Contact:

Re: HMG 3.0.36 (Test 2011-03-22)

Post by gfilatov »

Ricci wrote:Well Grigory, good to have the "flat" design back, but .... all my icons inside the program are gone :(
Hi Ricci,

You are right!

I've changed a file hmg\hmg.hbc to
incpaths=include
libpaths=lib
incpaths=\hmg\include
libpaths=\hmg\lib
libs=hbmzip.hbc
libs=hbwin.hbc
libs=${hb_name}${__HB_DYN__}
libs=hbct.hbc
gui=yes
{win}sources=${hb_curdir}_temp.o
and add to the file hmg\buildapp.bat the following strings:

Code: Select all

@echo off

SET HMGPATH=c:\hmg

SET PATH=%HMGPATH%\harbour\bin;%HMGPATH%\mingw\bin;%PATH%

echo #define HMGRPATH %HmgPath%\RESOURCES > _hmg_resconfig.h

COPY /b %HMGPATH%\resources\hmg.rc+%~n1.rc+%HMGPATH%\resources\filler _temp.rc >NUL
windres -i _temp.rc -o _temp.o

HBMK2 -gtgui %1 %2 %3 %4 %5 %6 %7 %8 -i%hmgpath%\include -lmsvfw32 -lvfw32 -run

del _hmg_resconfig.h
del _temp.*
The result is: main demo have a themed look and custom resources both.

Hope that helps :idea:
Kind Regards,
Grigory Filatov

"Everything should be made as simple as possible, but no simpler." Albert Einstein
Ricci
Posts: 255
Joined: Thu Nov 19, 2009 2:23 pm

Re: HMG 3.0.36 (Test 2011-03-22)

Post by Ricci »

gfilatov wrote:Hope that helps :idea:
Grigory, you are the real HMG wizard !

Thank you, all problems are solved ( whatever you have done ;) ).
User avatar
l3whmg
Posts: 694
Joined: Mon Feb 23, 2009 8:46 pm
Location: Italy
Contact:

Re: HMG 3.0.36 (Test 2011-03-22)

Post by l3whmg »

Hi Grigory, Hi Ricci
I'm sorry but I dont' understand your answer.
I don't lost any icon with my batch command, infact Grigory has replicated with the same.
And I can't see any reason to add in .hbc file: windres create an object file and you can insert this as a parameter for HBMK2.
Perhaps, the problem can be for demo sources.

Cheers.
Luigi from Italy
www.L3W.it
Ricci
Posts: 255
Joined: Thu Nov 19, 2009 2:23 pm

Re: HMG 3.0.36 (Test 2011-03-22)

Post by Ricci »

Luigi, maybe yours worked because you didn´t use the standard build-files from the 3.0.36 download?

If you download and install the version in a new dir and compile the main.demo you will see no grafic on the two buttons and you have the 3D design.
User avatar
l3whmg
Posts: 694
Joined: Mon Feb 23, 2009 8:46 pm
Location: Italy
Contact:

Re: HMG 3.0.36 (Test 2011-03-22)

Post by l3whmg »

Hi Ricci,
of course, you are right! As I write, the problem can be demos program.
I give you my kwnoledge.
There are two types of resource compiler: windres and rcc.
The first must used with HMG3 and the second with HMG4. With HMG4 (it use HbQt) we must add a .qrc file to the end of .hbp (in this way harbour can create a little source with function to register images); this can be a problem because HMG have its image and the end user can have other, but the problem from now can be for HMG3.

Now I write about HMG3 only.
Hbmk2 (harbour/mingw) can handle windres object file, in this way:
HBMK2 -o<FileName> <HrbFlags> <GccFlags> <OtherOpt> -lhmg -lvfw32 -lmsvfw32 <Source> <ResCompiled>
in <ResCompiled> we can assign the resources file name compiled with WindRes.
Normally, we assign at <ResCompiled> "hmg.o" value; but if I have other resource how can I do?
Well, in my case I can have: a standard set of icons and image and a customized set.
For this reason, I must create a new compiled resource file. This it's a little piece of my batch command.
Note: L3WRES if == 0 I dont' want standard set and L3WRESFILE is the standard.rc file, but I can have or not a localized set (cusimage.rc). Normally, HMGRESFILE is set to hmg.o

Code: Select all

IF %L3WRES%==0 IF NOT EXIST cusimage.rc GOTO compila
ECHO #define HMGRPATH %HMGPATH%\RESOURCES > %RESHEADER%
IF %L3WRES%==1 ECHO #define L3WRPATH %L3WRESPATH% >> %RESHEADER%
IF %L3WRES%==1 IF EXIST cusimage.rc COPY /b %HMGPATH%\resources\hmg.rc+cusimage.rc+%L3WRESFILE%+%HMGPATH%\resources\filler %TMPRES% >NUL
IF %L3WRES%==1 IF NOT EXIST cusimage.rc COPY /b %HMGPATH%\resources\hmg.rc+%L3WRESFILE%+%HMGPATH%\resources\filler %TMPRES% >NUL
IF %L3WRES%==0 IF EXIST cusimage.rc COPY /b %HMGPATH%\resources\hmg.rc+cusimage.rc+%HMGPATH%\resources\filler %TMPRES% >NUL
windres -i %TMPRES% -o _temp.o > %WRESLOG% 2>&1
IF ERRORLEVEL 1 GOTO error03
SET HMGRESFILE=_temp.o

:compila
SET PRGFLAG=-prgflag=-q -es2 %WLEV%
HBMK2 -o<FileName> <HrbFlags> <GccFlags> <OtherOpt> -lhmg -lvfw32 -lmsvfw32 -lhmg -lvfw32 -lmsvfw32 %1 %HMGRESFILE% > %HRBLOG% 2>&1
IF ERRORLEVEL 1 GOTO error04
And work fine, with some changes I can compile HMG4 programs.

My question was - perhaps English not good - if HMG insert the resource file hmg.o inside some .hbc or .hbp file, Can I have duplicated? Can I have errors?
Of course, current buildapp.bat it's no good, but I think it's not a good strategy insert hmg.o in any .hbc or .hbp file. If this will be done, -perhaps- I must crack MiniGui installation files.

On the other hand, I think HMG must remove MINGW directory and include a complete version of Harbour (without cleanup): it contain (harbour\comp\...) the MinGw compiler (works fine with HMG3 and HMG4). With my batch file I can use Harbour MinGw or official MinGw installation, but I don't use Hmg Harbour/MinGw.

That's all folk.

Cheers
Luigi from Italy
www.L3W.it
Ricci
Posts: 255
Joined: Thu Nov 19, 2009 2:23 pm

Re: HMG 3.0.36 (Test 2011-03-22)

Post by Ricci »

Luigi, to tell the truth: i already gave up understanding how to handle all these files (hmg.hbc, buildapp.bat, 'project'.hbc) für compilation and linking.

In 3.0.35 it was easy but now it´s sometimes only try and error. Difficult to find which libs to add to the hbc-files because so many functions are missing. I.e. where is the fuction curdrive() ... I found it in the hbxpp lib and in libharbour-21, libhbextern and libhbrtl too. So which lib do I have to add to hmg.hbc? I tried hbxpp and it works. Only luck?
User avatar
l3whmg
Posts: 694
Joined: Mon Feb 23, 2009 8:46 pm
Location: Italy
Contact:

Re: HMG 3.0.36 (Test 2011-03-22)

Post by l3whmg »

Hi Ricci,
these problems because old HMG3 hide some dependencies...
You have two possibility:
1 - change "curdrive" function with "hb_curdrive". I think it is good to use - when you can - the functions hb_xxxxx. In this way, you should not need additional libraries (they are in runtime library)
2 - From now, I think it's better to use .hbp and .hbc files.
This is my .hbp for a project:
D:\HMiniGui\HMiniGui3\Hmg\hmg.hbc
standard.hbc

mainprg.prg
sub1prg.prg
subprg2.prg
etc.
Obviously, You must change "D:\HMiniGui\HMiniGui3\Hmg" with your path!
This it's standard.hbc
incpaths=D:\HMiniGui\HMiniGui3\L3wSys\Lib
libpaths=D:\HMiniGui\HMiniGui3\L3wSys\Lib
libs=l3w_dbf xhab hbmisc
I add "D:\HMiniGui\HMiniGui3\L3wSys\Lib" and "l3w_dbf" because I have my personal libraries, but here you can add more libraries and or include file. Note: you can have "libpaths=", "incpaths=" and "libs=xhab hbmisc".
Attention: you must separate the names with a space.
Most important: pay attention to the path for compilers. if they are not valued correctly you will have problems.
Normally, in my batch command, I preserve the path, then add new values and at the end I restore the save value. In this way You don't alter current environment setup.
I hope this is clear. Dont' hesitate to contact me if you need. I spend a lot of time with previous HMG3 to work in a good way and with new HMG3 I'm confortable.

Cheers
Luigi from Italy
www.L3W.it
Ricci
Posts: 255
Joined: Thu Nov 19, 2009 2:23 pm

Re: HMG 3.0.36 (Test 2011-03-22)

Post by Ricci »

l3whmg wrote: 1 - change "curdrive" function with "hb_curdrive". I think it is good to use - when you can - the functions hb_xxxxx. In this way, you should not need additional libraries (they are in runtime library)
Thank you, Luigi.

Btw. where do I find infos about all available hb_xxxx functions?

Ricci
User avatar
l3whmg
Posts: 694
Joined: Mon Feb 23, 2009 8:46 pm
Location: Italy
Contact:

Re: HMG 3.0.36 (Test 2011-03-22)

Post by l3whmg »

Hi Ricci, this is a big problem (for me)!
Grigory give us a "complete" list ( there is my post but I don't find url), but it's a list. There isn't any description.
With Harbour changelog it's impossible. I think with Harbour official website, but I don't find all.
Normally, I do a search within the harbour source directories (I install binary and source) or I read "something" about and I do a search.

I'm sorry: I can't give a good solution. If someone can give use alternative.....

Cheers
Luigi from Italy
www.L3W.it
Post Reply