View Issue Details

IDProjectCategoryView StatusLast Update
0022152LazarusOtherpublic2012-06-05 09:09
ReporterLudo BrandsAssigned ToMaxim Ganetsky 
PrioritynormalSeverityminorReproducibilityalways
Status closedResolutionfixed 
Product Version1.1 (SVN)Product Build 
Target VersionFixed in Version1.1 (SVN) 
Summary0022152: [Patch] LazActiveX doesn't compile for WinCE
DescriptionThe LazActiveX package registers the "import typelib" menu. The ide menu extension is not needed for wince and the typelib unit can not be ported to Wince. It fails to compile when cross-compiling the package for WinCE. Attached patch removes the typelib related code and units when compiling for WinCE.
activexcontainer.pas also contains a few stubs for API functions that are not defined in WinCE.
Additional InformationThe eventsink and stdole2 units in packages\winunits-base\src also need to be compiled for wince. I'll submit another issue for that against fpc.
If they are needed, adding these units to the project dir works fine.
TagsNo tags attached.
Fixed in Revision37521
LazTarget-
WidgetsetWinCE
Attached Files
  • lazactiveX.diff (2,016 bytes)
    Index: importtypelib.pas
    ===================================================================
    --- importtypelib.pas	(revision 37403)
    +++ importtypelib.pas	(working copy)
    @@ -4,6 +4,7 @@
     
     interface
     
    +{$ifndef wince}
     uses
       Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, EditBtn,
       StdCtrls,lazideintf,projectintf,PackageIntf;
    @@ -33,9 +34,11 @@
       FrmTL: TFrmTL;
     
     procedure ImpTypeLib(Sender: TObject);
    +{$endif wince}
     
     implementation
     
    +{$ifndef wince}
     uses typelib;
     
     procedure ImpTypeLib(Sender: TObject);
    @@ -138,6 +141,7 @@
     end;
     
     {$R *.lfm}
    +{$endif wince}
     
     end.
     
    Index: activexcontainer.pas
    ===================================================================
    --- activexcontainer.pas	(revision 37403)
    +++ activexcontainer.pas	(working copy)
    @@ -209,7 +209,26 @@
     
     implementation
     
    +{$ifdef wince}
    +const
    +  GWLP_USERDATA=GWL_USERDATA;
     
    +function GetWindowLongPtrW(hWnd:HWND; nIndex:longint):LONG;
    +begin
    +  result:=GetWindowLongW(hWnd, nIndex);
    +end;
    +
    +function SetWindowLongPtrW(hWnd:HWND; nIndex:longint; dwNewLong:LONG):LONG;
    +begin
    +  result:=SetWindowLongW(hWnd, nIndex, dwNewLong);
    +end;
    +
    +function SetWindowLongPtr(hWnd:HWND; nIndex:longint; dwNewLong:LONG):LONG;
    +begin
    +  result:=SetWindowLongW(hWnd, nIndex, dwNewLong);
    +end;
    +{$endif wince}
    +
     function WndCallback(Ahwnd: HWND; uMsg: UINT; wParam: WParam;
       lParam: LParam): LRESULT; stdcall;
       var
    Index: lazactivexreg.pas
    ===================================================================
    --- lazactivexreg.pas	(revision 37403)
    +++ lazactivexreg.pas	(working copy)
    @@ -33,7 +33,11 @@
     interface
     
     uses
    -  activexcontainer,ImportTypelib;
    +  activexcontainer
    +  {$ifndef wince}
    +  ,ImportTypelib
    +  {$endif wince}
    +  ;
     
     procedure Register;
     
    @@ -44,7 +48,9 @@
     
     procedure Register; 
     begin
    +  {$ifndef wince}
       RegisterIDEMenuCommand(itmSecondaryTools, 'ImportTL','Import Type Library',nil,@ImpTypeLib);
    +  {$endif wince}
       RegisterComponents('ActiveX', [TActiveXContainer]);
     end;
     
    
    lazactiveX.diff (2,016 bytes)

Relationships

related to 0022157 closedMarco van de Voort FPC [Patch] WinCE needs the eventsink and stdole2 units to support OLE objects 

Activities

2012-05-30 13:28

 

lazactiveX.diff (2,016 bytes)
Index: importtypelib.pas
===================================================================
--- importtypelib.pas	(revision 37403)
+++ importtypelib.pas	(working copy)
@@ -4,6 +4,7 @@
 
 interface
 
+{$ifndef wince}
 uses
   Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, EditBtn,
   StdCtrls,lazideintf,projectintf,PackageIntf;
@@ -33,9 +34,11 @@
   FrmTL: TFrmTL;
 
 procedure ImpTypeLib(Sender: TObject);
+{$endif wince}
 
 implementation
 
+{$ifndef wince}
 uses typelib;
 
 procedure ImpTypeLib(Sender: TObject);
@@ -138,6 +141,7 @@
 end;
 
 {$R *.lfm}
+{$endif wince}
 
 end.
 
Index: activexcontainer.pas
===================================================================
--- activexcontainer.pas	(revision 37403)
+++ activexcontainer.pas	(working copy)
@@ -209,7 +209,26 @@
 
 implementation
 
+{$ifdef wince}
+const
+  GWLP_USERDATA=GWL_USERDATA;
 
+function GetWindowLongPtrW(hWnd:HWND; nIndex:longint):LONG;
+begin
+  result:=GetWindowLongW(hWnd, nIndex);
+end;
+
+function SetWindowLongPtrW(hWnd:HWND; nIndex:longint; dwNewLong:LONG):LONG;
+begin
+  result:=SetWindowLongW(hWnd, nIndex, dwNewLong);
+end;
+
+function SetWindowLongPtr(hWnd:HWND; nIndex:longint; dwNewLong:LONG):LONG;
+begin
+  result:=SetWindowLongW(hWnd, nIndex, dwNewLong);
+end;
+{$endif wince}
+
 function WndCallback(Ahwnd: HWND; uMsg: UINT; wParam: WParam;
   lParam: LParam): LRESULT; stdcall;
   var
Index: lazactivexreg.pas
===================================================================
--- lazactivexreg.pas	(revision 37403)
+++ lazactivexreg.pas	(working copy)
@@ -33,7 +33,11 @@
 interface
 
 uses
-  activexcontainer,ImportTypelib;
+  activexcontainer
+  {$ifndef wince}
+  ,ImportTypelib
+  {$endif wince}
+  ;
 
 procedure Register;
 
@@ -44,7 +48,9 @@
 
 procedure Register; 
 begin
+  {$ifndef wince}
   RegisterIDEMenuCommand(itmSecondaryTools, 'ImportTL','Import Type Library',nil,@ImpTypeLib);
+  {$endif wince}
   RegisterComponents('ActiveX', [TActiveXContainer]);
 end;
 
lazactiveX.diff (2,016 bytes)

Ludo Brands

2012-06-03 18:30

developer   ~0060231

Last edited: 2012-06-03 18:30

0022157: [Patch] WinCE needs the eventsink and stdole2 units to support OLE objects
is committed in FPC trunk.

Maxim Ganetsky

2012-06-04 23:07

developer   ~0060278

Applied, thanks.

Issue History

Date Modified Username Field Change
2012-05-30 13:28 Ludo Brands New Issue
2012-05-30 13:28 Ludo Brands File Added: lazactiveX.diff
2012-05-30 13:28 Ludo Brands Widgetset => WinCE
2012-06-03 18:30 Ludo Brands Note Added: 0060231
2012-06-03 18:30 Ludo Brands Note Edited: 0060231
2012-06-04 23:07 Maxim Ganetsky Fixed in Revision => 37521
2012-06-04 23:07 Maxim Ganetsky LazTarget => -
2012-06-04 23:07 Maxim Ganetsky Status new => resolved
2012-06-04 23:07 Maxim Ganetsky Fixed in Version => 1.1 (SVN)
2012-06-04 23:07 Maxim Ganetsky Resolution open => fixed
2012-06-04 23:07 Maxim Ganetsky Assigned To => Maxim Ganetsky
2012-06-04 23:07 Maxim Ganetsky Note Added: 0060278
2012-06-04 23:08 Maxim Ganetsky Relationship added related to 0022157
2012-06-05 09:09 Ludo Brands Status resolved => closed