HMG 64 Bit Constante -> FiveWin ?

HMG 64 Bit Constante -> FiveWin ?

Postby Jimmy » Wed Oct 19, 2022 6: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
User avatar
Jimmy
 
Posts: 1725
Joined: Thu Sep 05, 2019 5:32 am
Location: Hamburg, Germany

Re: HMG 64 Bit Constante -> FiveWin ?

Postby nageswaragunupudi » Thu Oct 20, 2022 6:08 pm

Code: Select all  Expand view
HB_xxxx
Regards

G. N. Rao.
Hyderabad, India
User avatar
nageswaragunupudi
 
Posts: 10620
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: HMG 64 Bit Constante -> FiveWin ?

Postby Jimmy » Fri Oct 21, 2022 5: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
User avatar
Jimmy
 
Posts: 1725
Joined: Thu Sep 05, 2019 5:32 am
Location: Hamburg, Germany

Re: HMG 64 Bit Constante -> FiveWin ?

Postby nageswaragunupudi » Fri Oct 21, 2022 7: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
User avatar
nageswaragunupudi
 
Posts: 10620
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: HMG 64 Bit Constante -> FiveWin ?

Postby Jimmy » Sat Oct 22, 2022 1: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: Select all  Expand view
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 view
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
User avatar
Jimmy
 
Posts: 1725
Joined: Thu Sep 05, 2019 5:32 am
Location: Hamburg, Germany

Re: HMG 64 Bit Constante -> FiveWin ?

Postby nageswaragunupudi » Sat Oct 22, 2022 3: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
User avatar
nageswaragunupudi
 
Posts: 10620
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: HMG 64 Bit Constante -> FiveWin ?

Postby Jimmy » Sat Oct 22, 2022 4:40 am

hi,
nageswaragunupudi wrote:This code works for both 32/64 bits.
Code: Select all  Expand view
#include <fwh.h>  // from fwh\include
hWnd = ( HWND ) fw_parH( 1 );  

Ah, there are Prefix "fw_" come from, thx :D

but what about String Constant like hb_parc or hb_parvc under Fivewin :?:
greeting,
Jimmy
User avatar
Jimmy
 
Posts: 1725
Joined: Thu Sep 05, 2019 5:32 am
Location: Hamburg, Germany

Re: HMG 64 Bit Constante -> FiveWin ?

Postby Antonio Linares » Sat Oct 22, 2022 5: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
User avatar
Antonio Linares
Site Admin
 
Posts: 42068
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: HMG 64 Bit Constante -> FiveWin ?

Postby Jimmy » Sat Oct 22, 2022 7: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: Select all  Expand view
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
User avatar
Jimmy
 
Posts: 1725
Joined: Thu Sep 05, 2019 5:32 am
Location: Hamburg, Germany

Re: HMG 64 Bit Constante -> FiveWin ?

Postby Antonio Linares » Sat Oct 22, 2022 7:56 am

correct! :-)
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42068
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: HMG 64 Bit Constante -> FiveWin ?

Postby Jimmy » Sat Oct 22, 2022 9: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: Select all  Expand view
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
User avatar
Jimmy
 
Posts: 1725
Joined: Thu Sep 05, 2019 5:32 am
Location: Hamburg, Germany

Re: HMG 64 Bit Constante -> FiveWin ?

Postby Jimmy » Sat Oct 22, 2022 9:30 am

hi,

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

Code: Select all  Expand view
#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 :shock:

seems to be a long 64 Bit Way ...
greeting,
Jimmy
User avatar
Jimmy
 
Posts: 1725
Joined: Thu Sep 05, 2019 5:32 am
Location: Hamburg, Germany

Re: HMG 64 Bit Constante -> FiveWin ?

Postby Enrico Maria Giordano » Sun Oct 23, 2022 9:09 am

I don't understand your problem. I recompiled my PRGs with FWH64 and they seem to work fine.
User avatar
Enrico Maria Giordano
 
Posts: 8710
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

Re: HMG 64 Bit Constante -> FiveWin ?

Postby Jimmy » 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 :D

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 view
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
User avatar
Jimmy
 
Posts: 1725
Joined: Thu Sep 05, 2019 5:32 am
Location: Hamburg, Germany

Re: HMG 64 Bit Constante -> FiveWin ?

Postby Enrico Maria Giordano » 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 :D


No, it is not. Please look at the PRGs of the FWH directories and you will find many samples of HB_FUNC() usage.
User avatar
Enrico Maria Giordano
 
Posts: 8710
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

Next

Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: Natter, Willi Quintana and 38 guests