Recent

Author Topic: loword on win64 message loop  (Read 1418 times)

quantumfoam

  • New Member
  • *
  • Posts: 23
loword on win64 message loop
« on: December 16, 2017, 10:06:51 pm »
I migrated my win-api based application to lazarus 1.8.0 64-bit. (from 32 bit)
Then I noticed error on mousewheel event when converting WPARAM by LOWORD function (base.inc)

Code: Pascal  [Select][+][-]
  1. function wndProc(hWnd: HWND; Msg: UINT; wParam: WPARAM; lParam: LPARAM): LRESULT; stdcall;
  2. begin
  3.   case Msg of
  4.   ....
  5.     WM_MOUSEWHEEL: begin
  6.       doSomeThing( KeysToShiftState( LOWORD(wParam), .... )
  7.     end;
  8.   end;
  9. end;

The error from Exception.Message is:
"Type procedure (parentfp_void_pointer, ANSISTRING) is not structure or union type"

Patching it to LOWORD( longint(wParam) ) seems to help, but is this the correct way?

jamie

  • Hero Member
  • *****
  • Posts: 6130
Re: loword on win64 message loop
« Reply #1 on: December 16, 2017, 11:21:52 pm »
most of those parameters are 64 bit now so you may need to correct for that.

 Also, why not use the already provided mouse handlers in the LCL ?
they have mouse.
 you can also define a message handler in the form class..

The only true wisdom is knowing you know nothing

 

TinyPortal © 2005-2018