HMG Listview Request

General Help regarding HMG, Compilation, Linking, Samples

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 Listview Request

Post by AUGE_OHR »

hi,

when work on "compare" i used my Xbase++ Code and got these Error
R:/Temp/hbmk_y6ujoh.dir/HBFM.o:HBFM.c:(.data+0xb48): undefined reference to `HB_FUN_LISTVIEW_GETSELECTIONMARK'
R:/Temp/hbmk_y6ujoh.dir/HBFM.o:HBFM.c:(.data+0xb58): undefined reference to `HB_FUN_LISTVIEW_GETSELECTEDCOUNT'
R:/Temp/hbmk_y6ujoh.dir/HBFM.o:HBFM.c:(.data+0xb68): undefined reference to `HB_FUN_LISTVIEW_GETNEXTITEM'
i know (now) they are not need for HMG Syntax but it would be fine if HMG have HB_FUNC() for it.
have fun
Jimmy
User avatar
gfilatov
Posts: 1090
Joined: Fri Aug 01, 2008 5:42 am
Location: Ukraine
Contact:

Re: HMG Listview Request

Post by gfilatov »

AUGE_OHR wrote: Wed Jan 29, 2020 7:51 am hi,
...
R:/Temp/hbmk_y6ujoh.dir/HBFM.o:HBFM.c:(.data+0xb48): undefined reference to `HB_FUN_LISTVIEW_GETSELECTIONMARK'
R:/Temp/hbmk_y6ujoh.dir/HBFM.o:HBFM.c:(.data+0xb58): undefined reference to `HB_FUN_LISTVIEW_GETSELECTEDCOUNT'
R:/Temp/hbmk_y6ujoh.dir/HBFM.o:HBFM.c:(.data+0xb68): undefined reference to `HB_FUN_LISTVIEW_GETNEXTITEM'
i know (now) they are not need for HMG Syntax but it would be fine if HMG have HB_FUNC() for it.
Hi Jimmy,

The function LISTVIEW_GETNEXTITEM is the C-function LISTVIEW_GETFIRSTITEM in HMG.

#define LVM_FIRST 0x1000
#define LVM_GETSELECTEDCOUNT (LVM_FIRST+50)
#define LVM_GETSELECTIONMARK (LVM_FIRST+66)

lResult = SendMessage(hwndLV, LVM_GETSELECTIONMARK, 0, 0)

dwResult = SendMessage(hwndLV, LVM_GETSELECTEDCOUNT, 0, 0)

where
hwndLV is a handle of your GRID control, i.e. Form.Grid.Handle.

HTH :idea:
Kind Regards,
Grigory Filatov

"Everything should be made as simple as possible, but no simpler." Albert Einstein
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 Listview Request

Post by AUGE_OHR »

hi,

i have made those 3 Function.

Code: Select all

HB_FUNC ( LISTVIEW_GETSELECTEDCOUNT )
{
   hb_retnl ( SendMessage( (HWND) hb_parnl (1),LVM_GETSELECTEDCOUNT,0,0 ) ) ;
}

HB_FUNC ( LISTVIEW_GETSELECTIONMARK )
{
   hb_retnl ( SendMessage( (HWND) hb_parnl (1), LVM_GETSELECTIONMARK,0,0 ) ) ;
}

HB_FUNC ( LISTVIEW_GETNEXTITEM )
{
   HWND hwnd = (HWND) hb_parnl (1);
   hb_retni ( ListView_GetNextItem( (HWND) hb_parnl (1), hb_parnl (2) , LVNI_SELECTED ));
}
not sure about hb_parnl (2) in LISTVIEW_GETNEXTITEM ... do i have to init it :idea:
https://docs.microsoft.com/en-us/window ... etnextitem
have fun
Jimmy
Post Reply