FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour HMG 64 Bit Constante -> FiveWin ?
Posts: 1772
Joined: Thu Sep 05, 2019 05:32 AM
HMG 64 Bit Constante -> FiveWin ?
Posted: Wed Oct 19, 2022 06:16 AM
hi,

HMG use Prefix "HMG_" for 64 Bit compatible Way
HMG_parnl
HMG_parvc
HMG_parc

HMG_arrayGetCPtr

HMG_retc
HMG_retnl
HMG_storc
HMG_storvnl
HMG_storvc

did FiveWin have a Prefix for 64 Bit ( fw_ ) :-)
greeting,

Jimmy
Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM
Re: HMG 64 Bit Constante -> FiveWin ?
Posted: Thu Oct 20, 2022 06:08 PM
Code (fw): Select all Collapse
HB_xxxx
Regards



G. N. Rao.

Hyderabad, India
Posts: 1772
Joined: Thu Sep 05, 2019 05:32 AM
Re: HMG 64 Bit Constante -> FiveWin ?
Posted: Fri Oct 21, 2022 05:01 AM
hi,

i got this
Warning W8065 HB_FUNC.PRG 41: Call to function 'HB_parc' with no prototype in function HB_FUN_LV_INSERTCOLUMN
Warning W8065 HB_FUNC.PRG 74: Call to function 'HB_parvc' with no prototype in function HB_FUN_ADDLISTVIEWITEMS
Warning W8065 HB_FUNC.PRG 79: Call to function 'HB_parvc' with no prototype in function HB_FUN_ADDLISTVIEWITEMS
Warning W8065 HB_FUNC.PRG 145: Call to function 'HB_parvc' with no prototype in function HB_FUN_LV_SETITEMTEXT

Error: Unresolved external '_HB_parc' referenced from C:\FWH\0\LISTVIEW\TGRID.OBJ
Error: Unresolved external '_HB_parvc' referenced from C:\FWH\0\LISTVIEW\TGRID.OBJ

do i need ti #include something :-)

p.s. same with Prefix "Fw_"
greeting,

Jimmy
Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM
Re: HMG 64 Bit Constante -> FiveWin ?
Posted: Fri Oct 21, 2022 07:34 AM

hb_par* function are to be used inside "c" functions.

Please read some *.c source files and some c code inside prg files

see hbapi.h in (x)Harbour include folder

Regards



G. N. Rao.

Hyderabad, India
Posts: 1772
Joined: Thu Sep 05, 2019 05:32 AM
Re: HMG 64 Bit Constante -> FiveWin ?
Posted: Sat Oct 22, 2022 01:07 AM
hi,
hb_par* function are to be used inside "c" functions.

i do talk about HB_FUNC()

this is HMG Syntax Sample using HMG_parc()
Code (fw): Select all Collapse
HB_FUNC ( LISTVIEW_ADDCOLUMN )
{
   LV_COLUMN COL;

   COL.mask= LVCF_WIDTH | LVCF_TEXT | LVCF_FMT | LVCF_SUBITEM ;
   COL.cx= hb_parni(3);
   COL.pszText = (TCHAR*) HMG_parc(4);
   COL.iSubItem=hb_parni(2)-1;
   COL.fmt = hb_parni(5) ;

this Sample show HMG_parvc()
Code (fw): Select all Collapse
HB_FUNC ( ADDLISTVIEWITEMS )
{
   HWND hWnd;
   LV_ITEM LI; 
   int nColumnCount, nCol, nRow;

   hWnd = (HWND) HMG_parnl (1);
   nColumnCount = hb_parinfa (2, 0);

   if ( HB_ISNIL(4) )
      nRow = ListView_GetItemCount (hWnd);
   else
      nRow = hb_parni (4); 

   LI.mask       = LVIF_TEXT | LVIF_IMAGE;
   LI.state      = 0;
   LI.stateMask  = 0;
   LI.iImage     = hb_parni (3);
   LI.iSubItem   = 0;
   LI.iItem      = nRow;
   LI.pszText    = (TCHAR*) HMG_parvc (2, 1);

   ListView_InsertItem (hWnd, &LI);

   for (nCol = 1; nCol < nColumnCount; nCol++)
       ListView_SetItemText (hWnd, nRow, nCol, (TCHAR*) HMG_parvc (2, nCol+1));
}

when replace "HMG_" with "hb_" it work with 32 Bit but how using Fivewin and 64 Bit :-)
greeting,

Jimmy
Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM
Re: HMG 64 Bit Constante -&gt; FiveWin ?
Posted: Sat Oct 22, 2022 03:44 AM

This code works for both 32/64 bits.

Include

include <fwh.h> // from fwh\include

hWnd = ( HWND ) fw_parH( 1 );

This works with both 32 and 64 bits to return a HANDLE.
Cast to any HANDLE like (HWND), etc

Note: Use this for HANDLEs only.

Regards



G. N. Rao.

Hyderabad, India
Posts: 1772
Joined: Thu Sep 05, 2019 05:32 AM
Re: HMG 64 Bit Constante -&gt; FiveWin ?
Posted: Sat Oct 22, 2022 04:40 AM
hi,
nageswaragunupudi wrote:This code works for both 32/64 bits.
Code (fw): Select all Collapse
#include <fwh.h>  // from fwh\include
hWnd = ( HWND ) fw_parH( 1 );

Ah, there are Prefix "fw_" come from, thx :-)

but what about String Constant like hb_parc or hb_parvc under Fivewin :-)
greeting,

Jimmy
Posts: 44162
Joined: Thu Oct 06, 2005 05:47 PM
Re: HMG 64 Bit Constante -&gt; FiveWin ?
Posted: Sat Oct 22, 2022 05:45 AM

Dear Jimmy,

> but what about String Constant like hb_parc or hb_parvc under Fivewin

You use those standard functions and they work fine, as expected

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 1772
Joined: Thu Sep 05, 2019 05:32 AM
Re: HMG 64 Bit Constante -&gt; FiveWin ?
Posted: Sat Oct 22, 2022 07:21 AM
hi Antonio,
Antonio Linares wrote:
> but what about String Constant like hb_parc or hb_parvc under Fivewin
You use those standard functions and they work fine, as expected

sorry i made wrong Question. it is not 64 Bit it is Unicode for String

now i found this
Code (fw): Select all Collapse
FiveWin Unicode
   if ( FW_GetUnicode() )
   {
   LPCWSTR lpOperation  = fw_parWide( 2 );
   LPCWSTR lpFile       = fw_parWide( 3 );
   LPCWSTR lpParameters = fw_parWide( 4 );
   LPCWSTR lpDirectory  = fw_parWide( 5 );

   ShellExecuteW( ( HWND ) fw_parH( 1 )
greeting,

Jimmy
Posts: 44162
Joined: Thu Oct 06, 2005 05:47 PM
Re: HMG 64 Bit Constante -&gt; FiveWin ?
Posted: Sat Oct 22, 2022 07:56 AM

correct! :-)

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 1772
Joined: Thu Sep 05, 2019 05:32 AM
Re: HMG 64 Bit Constante -&gt; FiveWin ?
Posted: Sat Oct 22, 2022 09:09 AM
hi,

here Error from MSVC 64 Bit, need some Help please

TGRID.c
HB_FUNC.PRG(61): warning C4244: "=": Konvertierung von "HB_SIZE" in "int", möglicher Datenverlust
HB_FUNC.PRG(138): warning C4244: "Initialisierung": Konvertierung von "HB_SIZE" in "int", möglicher Datenverlust
HB_FUNC.PRG(214): warning C4312: "Typumwandlung": Konvertierung von "long" in größeren Typ "HIMAGELIST"
HB_FUNC.PRG(220): error C2440: "Initialisierung": "HANDLE" kann nicht in "HBITMAP" konvertiert werden
HB_FUNC.PRG(220): note: Konvertierung von "void*" in Zeiger auf nicht-"void" erfordert eine explizite Typumwandlung


Code (fw): Select all Collapse
 61 nColumnCount = hb_parinfa (2, 0);
138 int  nLen = hb_parinfa (2, 0);
214 ImageList_RemoveAll( ( HIMAGELIST ) hb_parnl( 1 ) );
220 HBITMAP hBmp = LoadImage( NULL, ( LPCSTR ) hb_parnll( 1 ), IMAGE_BITMAP, 0, 0, 0 );
greeting,

Jimmy
Posts: 1772
Joined: Thu Sep 05, 2019 05:32 AM
Re: HMG 64 Bit Constante -&gt; FiveWin ?
Posted: Sat Oct 22, 2022 09:30 AM
hi,

i forgot to include "fwh.h" ...

Code (fw): Select all Collapse
#pragma BEGINDUMP

#include <windows.h>
#include <commctrl.h>
#include <hbapi.h>
#include <fwh.h>

//       LV_ChangeExtendedStyle ( hWnd, [ nAddStyle ], [ nRemoveStyle ] )
HB_FUNC( LV_CHANGEEXTENDEDSTYLE )
...

HB_FUNC.PRG(10): fatal error C1083: Datei (Include) kann nicht geöffnet werden: "fwh.h": No such file or directory

than i have copy "fwh.h" into same Folder, open CMD Box before try it again ... but same Result :-)

seems to be a long 64 Bit Way ...
greeting,

Jimmy
Posts: 9022
Joined: Thu Oct 06, 2005 08:17 PM
Re: HMG 64 Bit Constante -&gt; FiveWin ?
Posted: Sun Oct 23, 2022 09:09 AM

I don't understand your problem. I recompiled my PRGs with FWH64 and they seem to work fine.

Posts: 1772
Joined: Thu Sep 05, 2019 05:32 AM
Re: HMG 64 Bit Constante -&gt; FiveWin ?
Posted: Sun Oct 23, 2022 10:08 AM
hi Enrico,
Enrico Maria Giordano wrote:I don't understand your problem. I recompiled my PRGs with FWH64 and they seem to work fine.

my CLASS TGrid() use HB_FUNC() which are not Part of Fivewin, it is "new" for Fivewin :-)

for CLASS TGrip() i need HB_FUNC() which use "C"-Code and Parameter Type
but there is a Difference between 32 Bit and 64 Bit in Syntax

Sample : Grid does have "own" Function when press a Key
Code (fw): Select all Collapse
HB_FUNC( GETGRIDVKEY )
{
   #ifndef _WIN64
      LPARAM lParam = (LPARAM) hb_parnl (1);
   #else
      LPARAM lParam = (LPARAM) hb_parnll (1);
   #endif
   LV_KEYDOWN * LVK = (LV_KEYDOWN *) lParam;
   hb_retni ( LVK->wVKey );
}

you can see Constant _WIN64 which will be (automatic) SET to compile right CODE

---

i have CODE from HMG which use Prefix "HMG_" which include those _WIN64 when need
now i have to find out how it work under Fivewin 64 Bit ... and not all are available under HMG or used other Way

p.s. i´m not a "C" Programmer ... but i´m going to learn
greeting,

Jimmy
Posts: 9022
Joined: Thu Oct 06, 2005 08:17 PM
Re: HMG 64 Bit Constante -&gt; FiveWin ?
Posted: Sun Oct 23, 2022 10:12 AM
Jimmy wrote:my CLASS TGrid() use HB_FUNC() which are not Part of Fivewin, it is "new" for Fivewin :-)


No, it is not. Please look at the PRGs of the FWH directories and you will find many samples of HB_FUNC() usage.