FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour 64 Bit Warning MSVC
Posts: 1772
Joined: Thu Sep 05, 2019 05:32 AM
64 Bit Warning MSVC
Posted: Thu Nov 10, 2022 05:02 AM
hi,

need some help for 64 Bit
HB_FUNC.PRG(322): warning C4244: "Argument": Konvertierung von "LRESULT" in "int", möglicher Datenverlust
HB_FUNC.PRG(336): warning C4244: "Argument": Konvertierung von "LRESULT" in "int", möglicher Datenverlust
Code (fw): Select all Collapse
314 HB_FUNC( LV_GETSELECTEDCOUNT )
315 {
316   #ifndef _WIN64
317      HWND hWnd = ( HWND ) hb_parnl( 1 );
318   #else
319      HWND hWnd = ( HWND ) hb_parnll( 1 );
320   #endif
321   #ifdef AVOID_COMPILER_WARNING
322      hb_retni( SendMessage( hWnd, LVM_GETSELECTEDCOUNT, 0, 0) ) ;
323   #else
324      hb_retni( ListView_GetSelectedCount(hWnd) );
325   #endif
Code (fw): Select all Collapse
335   #ifdef AVOID_COMPILER_WARNING
336      hb_retni( SendMessage( hWnd, LVM_GETSELECTIONMARK, 0, 0) ) ;
337   #else
338      hb_retni( ListView_GetSelectionMark(hWnd) );
339   #endif
what do i have to enhance for 64 Bit :?:
greeting,

Jimmy
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: 64 Bit Warning MSVC
Posted: Thu Nov 10, 2022 06:52 AM

Dear Jimmy,

Please use hb_retnl() (and hb_retnll()) instead of hb_retni()

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 1772
Joined: Thu Sep 05, 2019 05:32 AM
Re: 64 Bit Warning MSVC
Posted: Fri Nov 11, 2022 09:59 AM
hi Antonio,
Antonio Linares wrote:Please use hb_retnl() (and hb_retnll()) instead of hb_retni()
YES, that work without Warning

---

Question :
now i have hb_retnll() for 64 Bit and 32 Bit and it also seems to work under 32 Bit ... do i need to change it :?:

normal ListView_GetSelectedCount() or ListView_GetSelectionMark() will not have a "big" Number ...
greeting,

Jimmy
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: 64 Bit Warning MSVC
Posted: Fri Nov 11, 2022 10:00 AM

Dear Jimmy,

You can safely use hb_retnll() in 32 bits

regards, saludos

Antonio Linares
www.fivetechsoft.com

Continue the discussion