HMG QHTM Sample

Discuss anything else that does not suite other forums.

Moderator: Rathinagiri

Post Reply
User avatar
AUGE_OHR
Posts: 2093
Joined: Sun Aug 25, 2019 3:12 pm
DBs Used: DBF, PostgreSQL, MySQL, SQLite
Location: Hamburg, Germany

HMG QHTM Sample

Post by AUGE_OHR »

hi,

it try to run QHTM Sample from c:\hmg.3.4.4\SAMPLES\HFCL\QHTM\Demo.Prg
Harbour 3.2.0dev (r1703241902)
Copyright (c) 1999-2016, http://harbour-project.org/
C:/hmg.3.4.4/lib\libhfcl.a(h_qhtm.o):h_qhtm.c:(.data+0x1f8): undefined reference to `HB_FUN_QHTM_GETSCROLLPOS'
C:/hmg.3.4.4/lib\libhfcl.a(h_qhtm.o):h_qhtm.c:(.data+0x208): undefined reference to `HB_FUN_QHTM_SETSCROLLPOS'
C:/hmg.3.4.4/lib\libhfcl.a(h_qhtm.o):h_qhtm.c:(.data+0x298): undefined reference to `HB_FUN_QHTM_SETZOOMLEVEL'
collect2.exe: error: ld returned 1 exit status
hbmk2[Demo]: Error: Running linker. 1
...
hbmk2: Error: Referenced, missing, but unknown function(s):
QHTM_GETSCROLLPOS(), QHTM_SETSCROLLPOS(), QHTM_SETZOOMLEVEL()
so i look at QHTM Source c:\hmg.3.4.4\hfcl\Source\h_qhtm.prg and run hfcl.hbp / buildlib.bat
Harbour 3.2.0dev (r1703241902)
Copyright (c) 1999-2016, http://harbour-project.org/
R:/Temp/hbmk_4nmkg6.dir/h_qhtm.o:h_qhtm.c:(.data+0x1f8): undefined reference to `HB_FUN_QHTM_GETSCROLLPOS'
R:/Temp/hbmk_4nmkg6.dir/h_qhtm.o:h_qhtm.c:(.data+0x208): undefined reference to `HB_FUN_QHTM_SETSCROLLPOS'
R:/Temp/hbmk_4nmkg6.dir/h_qhtm.o:h_qhtm.c:(.data+0x298): undefined reference to `HB_FUN_QHTM_SETZOOMLEVEL'
collect2.exe: error: ld returned 1 exit status
hbmk2[hfcl]: Error: Running linker. 1
...
hbmk2: Error: Referenced, missing, but unknown function(s):
QHTM_GETSCROLLPOS(), QHTM_SETSCROLLPOS(), QHTM_SETZOOMLEVEL()
there IS c:\hmg.3.4.4\hfcl\Source\qhtm.h and it have

Code: Select all

#define QHTM_GetScrollPos( hwnd )		((UINT) QHTM_SENDMESSAGE( (hwnd), QHTM_GET_SCROLL_POS, 0, 0) )
#define QHTM_SetScrollPos( hwnd, uScrollPos )	((UINT) QHTM_SENDMESSAGE( (hwnd), QHTM_SET_SCROLL_POS, (WPARAM)(uScrollPos), 0) )
#define QHTM_SetZoomLevel( hwnd, nLevel )	( (void) QHTM_SENDMESSAGE( hwnd, QHTM_SET_OPTION, QHTM_OPT_ZOOMLEVEL, (LPARAM)nLevel ) )
c:\hmg.3.4.4\hfcl\Source\c_qhtm.c have

Code: Select all

#include "qhtm.h"
so why i get these Error :?:

---

i found Difference in hfcl.hbp vs. hfcl-64.hbp

both "C" files missing

Code: Select all

-hblib

-Iinclude
-I../include

-D__HBIDE__

c_qhtm.c
RichEditBoxEx_C.c
i have to check it again but as i can say HMG IDE does remove those "C" files from *.HBP :shock:
so i run in CMD Box c:\hmg.3.4.4\hfcl\Source\buildlib.bat and got ... libAutoFill.a :roll:

as i don't find other libAutoFill.a on PC i guess it is not what HMG Demo use.
i do find libqhtm.a ... in Extendet Version where Demo work :!:

so how to get HMG Version work correct with c:\hmg.3.4.4\SAMPLES\HFCL\QHTM\Demo.Prg :idea:

---

i found in c:\hmg.3.4.4\INCLUDE\hfcl.ch

Code: Select all

#include "hfcl_combosearchbox.ch"
#include "hfcl_gridprint.ch"
#include "hfcl_qhtm.ch"
#include "hfcl_RichEditBoxEx.ch"
and in c:\hmg.3.4.4\INCLUDE\hfcl_qhtm.ch

Code: Select all

#xtranslate QHTM_GetScrollPos( <nHandle> )         => SendMessage( <nHandle>, QHTM_GET_SCROLL_POS, 0, 0 ) 
#xtranslate QHTM_SetScrollPos( <nHandle>, <nPos> ) => SendMessage( <nHandle>, QHTM_SET_SCROLL_POS, <nPos>, 0 )
#xtranslate QHTM_SetZoomLevel( <hWnd>, <nLevel> )  => SendMessage (<hWnd>, QHTM_SET_OPTION, QHTM_OPT_ZOOMLEVEL, <nLevel>)   // nLevel = 0 ... 4
now i'm (again) total confused :? Demo have #include "hfcl.ch"
have fun
Jimmy
User avatar
AUGE_OHR
Posts: 2093
Joined: Sun Aug 25, 2019 3:12 pm
DBs Used: DBF, PostgreSQL, MySQL, SQLite
Location: Hamburg, Germany

Re: HMG QHTM Sample

Post by AUGE_OHR »

got it run
hb_QHTM.jpg
hb_QHTM.jpg (86.46 KiB) Viewed 1643 times
in file c:\hmg.3.4.4\hfcl\Source\h_qhtm.prg you just have to include

Code: Select all

#include "hmg.ch"
#include "hfcl.ch"      //<- this
than run c:\hmg.3.4.4\hfcl\Source\buildlib.bat and you got libAutoFill.a
ren libAutoFill.a to libhfcl.a and copy/override c:\hmg.3.4.4\lib\libhfcl.a

now you can run QHTM Samoe with
c:\hmg.3.4.4\SAMPLES\HFCL\QHTM\build.bat

have fun
have fun
Jimmy
User avatar
AUGE_OHR
Posts: 2093
Joined: Sun Aug 25, 2019 3:12 pm
DBs Used: DBF, PostgreSQL, MySQL, SQLite
Location: Hamburg, Germany

Re: HMG QHTM Sample

Post by AUGE_OHR »

next big crash ... :cry:

as i say i got QHTM running with Demo Sample.
now i modify Sample this Way

Code: Select all

Function Main()
LOCAL i
 FOR i := 1 TO 10
   ShowQHTM()
 NEXT
RETURN

Function ShowQHTM(cBody)
...
  cHTMLFile := "QHTM API Reference and User Guide.htm"
and remove "MAIN;" from Original Sample

i can compile/link/run and all is fine.
but when press "close" for NEXT run than it crash :shock:
Called from DOMESSAGELOOP(0)
Called from _ACTIVATEWINDOW(5717) in source\h_windows.prg
Called from DOMETHOD(9003) in source\h_controlmisc.prg
Called from SHOWQHTM(91) in C:\hmg.3.4.4\0\MAIL\1\demo.prg
Called from MAIN(8) in C:\hmg.3.4.4\0\MAIL\1\demo.prg
------------------------------------------------------------------------

Code: Select all

30       ON RELEASE  QHTM_end();

89    END WINDOW
90    Form_1.Center
91    Form_1.Activate
92 Return Nil
---

c:\hmg.3.4.4\hfcl\Source\c_qhtm.c

Code: Select all

/*
   QHTM_End()
   Unload of library
*/
HB_FUNC( QHTM_END )
{
   if( hQhtmDll )
   {
      FreeLibrary( hQhtmDll );
      hQhtmDll = NULL;
   }
}
c:\hmg.3.4.4\hfcl\Source\qhtm.h

Code: Select all

	//
	//	Call this to initialise the QHTM.
	BOOL WINAPI QHTM_Initialize( HINSTANCE hInst );

	//
	//	Call this to shutdown QHTM.
	BOOL WINAPI QHTM_Uninitialize();
but QHTM_Uninitialize() is nowhere called ... is this the Problem :?:

---

when have

Code: Select all

typedef BOOL ( WINAPI *QHTM_INITIALIZE ) ( HINSTANCE hInst );
QHTM_INITIALIZE   pFunc = ( QHTM_INITIALIZE ) GetProcAddress( hQhtmDll, "QHTM_Initialize" );
so how does Syntax look like for QHTM_Uninitialize :?:
have fun
Jimmy
Post Reply