Page 1 of 2
HMG 64 Bit Constante -> FiveWin ?
Posted: Wed Oct 19, 2022 6:16 am
by Jimmy
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_ )

Re: HMG 64 Bit Constante -> FiveWin ?
Posted: Thu Oct 20, 2022 6:08 pm
by nageswaragunupudi
Re: HMG 64 Bit Constante -> FiveWin ?
Posted: Fri Oct 21, 2022 5:01 am
by Jimmy
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_"
Re: HMG 64 Bit Constante -> FiveWin ?
Posted: Fri Oct 21, 2022 7:34 am
by nageswaragunupudi
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
Re: HMG 64 Bit Constante -> FiveWin ?
Posted: Sat Oct 22, 2022 1:07 am
by Jimmy
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: Select all | Expand
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: Select all | Expand
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

Re: HMG 64 Bit Constante -> FiveWin ?
Posted: Sat Oct 22, 2022 3:44 am
by nageswaragunupudi
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.
Re: HMG 64 Bit Constante -> FiveWin ?
Posted: Sat Oct 22, 2022 4:40 am
by Jimmy
hi,
nageswaragunupudi wrote:This code works for both 32/64 bits.
Code: Select all | Expand
#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

Re: HMG 64 Bit Constante -> FiveWin ?
Posted: Sat Oct 22, 2022 5:45 am
by Antonio Linares
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
Re: HMG 64 Bit Constante -> FiveWin ?
Posted: Sat Oct 22, 2022 7:21 am
by Jimmy
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: Select all | Expand
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 )
Re: HMG 64 Bit Constante -> FiveWin ?
Posted: Sat Oct 22, 2022 7:56 am
by Antonio Linares
correct!

Re: HMG 64 Bit Constante -> FiveWin ?
Posted: Sat Oct 22, 2022 9:09 am
by Jimmy
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: Select all | Expand
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 );
Re: HMG 64 Bit Constante -> FiveWin ?
Posted: Sat Oct 22, 2022 9:30 am
by Jimmy
hi,
i forgot to include "fwh.h" ...
Code: Select all | Expand
#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 ...
Re: HMG 64 Bit Constante -> FiveWin ?
Posted: Sun Oct 23, 2022 9:09 am
by Enrico Maria Giordano
I don't understand your problem. I recompiled my PRGs with FWH64 and they seem to work fine.
Re: HMG 64 Bit Constante -> FiveWin ?
Posted: Sun Oct 23, 2022 10:08 am
by Jimmy
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: Select all | Expand
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
Re: HMG 64 Bit Constante -> FiveWin ?
Posted: Sun Oct 23, 2022 10:12 am
by Enrico Maria Giordano
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.