Browse Source

Fix compilation of fcl-process on WinCE

packages/fcl-process/src/winall/simpleipc.inc:
  * a WndProc needs to be declared as cdecl
  * WinCE does not provide Get-/SetWindowLongPtr() as it's 32-bit only anyway, so Get-/SetWindowLong() needs to be used

git-svn-id: trunk@33019 -
svenbarth 9 years ago
parent
commit
a3871c9d30
1 changed files with 3 additions and 3 deletions
  1. 3 3
      packages/fcl-process/src/winall/simpleipc.inc

+ 3 - 3
packages/fcl-process/src/winall/simpleipc.inc

@@ -190,7 +190,7 @@ end;
     MsgWndProc
     MsgWndProc
   ---------------------------------------------------------------------}
   ---------------------------------------------------------------------}
 
 
-function MsgWndProc(Window: HWND; uMsg: UINT; wParam: WPARAM; lParam: LPARAM): LRESULT; stdcall;
+function MsgWndProc(Window: HWND; uMsg: UINT; wParam: WPARAM; lParam: LPARAM): LRESULT; {$ifdef wince}cdecl;{$else}stdcall;{$endif}
 Var
 Var
   Server: TWinMsgServerComm;
   Server: TWinMsgServerComm;
   Msg: TMsg;
   Msg: TMsg;
@@ -202,7 +202,7 @@ begin
     // Post WM_USER to wake up GetMessage call.
     // Post WM_USER to wake up GetMessage call.
     PostMessage(Window, WM_USER, 0, 0);
     PostMessage(Window, WM_USER, 0, 0);
     // Read message data and add to message queue.
     // Read message data and add to message queue.
-    Server:=TWinMsgServerComm(GetWindowLongPtr(Window,GWL_USERDATA));
+    Server:=TWinMsgServerComm({$ifdef wince}GetWindowLong{$else}GetWindowLongPtr{$endif}(Window,GWL_USERDATA));
     if Assigned(Server) then
     if Assigned(Server) then
     begin
     begin
       Msg.Message:=uMsg;
       Msg.Message:=uMsg;
@@ -246,7 +246,7 @@ begin
     PWideChar(aWindowName), WS_POPUP {!0}, 0, 0, 0, 0, 0, 0, HInstance, nil);
     PWideChar(aWindowName), WS_POPUP {!0}, 0, 0, 0, 0, 0, 0, HInstance, nil);
   if (Result=0) then
   if (Result=0) then
     Owner.DoError(SErrFailedToCreateWindow,[aWindowName]);
     Owner.DoError(SErrFailedToCreateWindow,[aWindowName]);
-  SetWindowLongPtr(Result,GWL_USERDATA,PtrInt(Self));
+  {$ifdef wince}SetWindowLong{$else}SetWindowLongPtr{$endif}(Result,GWL_USERDATA,PtrInt(Self));
 end;
 end;
 
 
 constructor TWinMsgServerComm.Create(AOwner: TSimpleIPCServer);
 constructor TWinMsgServerComm.Create(AOwner: TSimpleIPCServer);