64 Bit Warning MSVC

64 Bit Warning MSVC

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

Re: 64 Bit Warning MSVC

Postby Antonio Linares » Thu Nov 10, 2022 6:52 am

Dear Jimmy,

Please use hb_retnl() (and hb_retnll()) instead of hb_retni()
regards, saludos

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

Re: 64 Bit Warning MSVC

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

Re: 64 Bit Warning MSVC

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


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: Google [Bot] and 82 guests