Recent

Author Topic: Strange Problem with an OCX Control  (Read 6185 times)

JochenKauz

  • New Member
  • *
  • Posts: 13
Strange Problem with an OCX Control
« on: May 30, 2017, 05:45:03 pm »
Hi,
I'm new here at the forum and I'm not really sure if this thread is at the right place, but I hope so.

I try to implement a MapControl in my Application, using an external OCX Control. In the past we used Mappoint from MS to do this, and it works like expected.
Now we have changed the manufacturer, cause Mappoint is not supported anymore.

All methods of binding (early or late) only result in an OLE Error, if I try to access a method or property of the OCX. A friend of mine tried it with Delphi and all is working. Even if I use the IDispatch.INVOKE with this Controls, I get the OLEError. I talked to the manufacturer, and he has no explanation for this.
I compared the DTB files of Mappoint and the new controls and I can see one big difference. The new controls only implement the dispinterface section, but there is no IDISPATCH section in the DTB.
Is this a limitation of FPC, that it can only work with an IDISPATCH interface, not with dispinterface only?

Best regards
JochenKauz


Thaddy

  • Hero Member
  • *****
  • Posts: 9278
Re: Strange Problem with an OCX Control
« Reply #1 on: May 30, 2017, 06:08:52 pm »
ONE VERY IMPORTANT ISSUE IS THAT MAPPOINT IS NOT SUPPORTED ANY MORE

Do not even try to use it. There's a reason big companies phase out their products.
Small companies that rely on that should do the same.

Get a budget to do a rewrite... Don't second guess the industry.

Your only viable option is to keep your Windows versions insecure.
Your friend is probably using XP and a very old version of Delphi.

Supported products from MS, interfacing with FPC code is not a problem at all.
« Last Edit: May 30, 2017, 06:16:43 pm by Thaddy »
also related to equus asinus.

JochenKauz

  • New Member
  • *
  • Posts: 13
Re: Strange Problem with an OCX Control
« Reply #2 on: May 30, 2017, 07:45:52 pm »
Hi,
yes you are right, that is the reason for my new programming.
As I wrote before, we used in the past Mappoint and switched now to a new component called Mapview. This Mapview OCX makes the trouble. My friend uses a similar system the me, and no.. not Windows XP:-).

I only used Mappoint to test if it is a general problem in my unit.

To be more precise, this is my system.
Windows 10 Professional 64Bit
Lazarus 1.6.4 with fpc 3.0.2 32 Bit.

I compile for 32Bit Windows and the Mapview OCX is 32Bit too.

Here is an example of the generated DTB file from import library.
Code: Pascal  [Select]
  1. Unit IWMAPVIEWCTRLLib_1_0_TLB;
  2.  
  3. //  Imported IWMAPVIEWCTRLLib on 30.05.2017 16:41:28 from C:\Program Files (x86)\infoware\mapsuite_3.9\GIS-Tools\lib\iwMapViewCtrl.ocx
  4.  
  5. {$mode delphi}{$H+}
  6.  
  7. interface
  8.  
  9. // Dependency: IWGEOOBJECTSLib v1.0 (C:\Program Files (x86)\infoware\mapsuite_3.9\GIS-Tools\lib\iwGeoObjects.dll)
  10. // Dependency: stdole v2 (stdole2.pas)
  11. Uses
  12.   Windows,ActiveX,Classes,Variants,IWGEOOBJECTSLib_1_0_TLB,stdole2,ActiveXContainer,
  13.   EventSink;
  14. Const
  15.   IWMAPVIEWCTRLLibMajorVersion = 1;
  16.   IWMAPVIEWCTRLLibMinorVersion = 0;
  17.   IWMAPVIEWCTRLLibLCID = 0;
  18.   LIBID_IWMAPVIEWCTRLLib : TGUID = '{85062597-A349-4A8F-8F70-46942316BF76}';
  19.  
  20.   IID__DiwMapViewCtrl : TGUID = '{357CEE48-2FD4-4311-9E92-1050A4429D8C}';
  21.   IID__DiwMapViewCtrlEvents : TGUID = '{764407BA-4EE6-4571-B735-B125470009DA}';
  22.   CLASS_iwMapViewCtrl : TGUID = '{50025AF2-1959-4417-B9F3-42B54C24BF55}';
  23.  
  24. //Enums
  25.  
  26. //Forward declarations
  27.  
  28. Type
  29.  _DiwMapViewCtrl = dispinterface;
  30.  _DiwMapViewCtrlEvents = dispinterface;
  31.  
  32. //Map CoClass to its default interface
  33.  
  34.  iwMapViewCtrl = _DiwMapViewCtrl;
  35.  
  36. //records, unions, aliases
  37.  
  38.  
  39. //interface declarations
  40.  
  41. // _DiwMapViewCtrl : Dispatch-Schnittstelle für iwMapView Control
  42.  
  43.  _DiwMapViewCtrl = dispinterface
  44.    ['{357CEE48-2FD4-4311-9E92-1050A4429D8C}']
  45.     // ZoomIn :  
  46.    function ZoomIn:Integer;dispid 101;
  47.     // ZoomOut :  
  48.    function ZoomOut:Integer;dispid 102;
  49.     // ZoomToPoints :  
  50.    function ZoomToPoints(geopoints:IiwGeoPoints;xMarginPercent:Integer;yMarginPercent:Integer;minWidth:Double;minHeight:Double):Integer;dispid 103;
  51.     // ZoomByFactor :  
  52.    function ZoomByFactor(factor:Double):Integer;dispid 104;
  53.     // Pan :  
  54.    function Pan(geopoint:IiwGeoPoint):Integer;dispid 105;
  55.     // ToMapPoint :  
  56.    function ToMapPoint(xval:Integer;yval:Integer;geopoint:IiwGeoPoint):Integer;dispid 106;
  57.     // FromMapPoint :  
  58.    function FromMapPoint(geopoint:IiwGeoPoint;xval:Integer;yval:Integer):Integer;dispid 107;
  59.     // SetFullExtent :  
  60.    function SetFullExtent:Integer;dispid 108;
  61.     // ActivateDynamicLayer :  
  62.    function ActivateDynamicLayer(key:WideString;keyvalue:WideString):Integer;dispid 109;
  63.     // DeactivateDynamicLayer :  
  64.    function DeactivateDynamicLayer(key:WideString):Integer;dispid 110;
  65.     // PrintMap :  
  66.    function PrintMap(hdc:OLE_HANDLE;x:Integer;y:Integer;width:Integer;height:Integer):Integer;dispid 111;
  67.     // RefreshMap :  
  68.    function RefreshMap:Integer;dispid 112;
  69.     // GetErrorDesc :  
  70.    function GetErrorDesc(error:Integer;description:WideString):Integer;dispid 113;
  71.     // IdentifyVisibleObjects :  
  72.    function IdentifyVisibleObjects(identifyX:Smallint;identifyY:Smallint;radiusInPixel:Integer;IdentifyLayerNames:WideString;getBorderPolygons:Smallint;xmlResult:WideString):Integer;dispid 114;
  73.     // IdentifyVisibleObjects1 :  
  74.    function IdentifyVisibleObjects1(maprect:IiwGeoRect;viewWidth:Smallint;viewHeight:Smallint;identifyX:Smallint;identifyY:Smallint;radiusInPixel:Integer;IdentifyLayerNames:WideString;getBorderPolygons:Smallint;xmlResult:WideString):Integer;dispid 115;
  75.     // GetDataProjectionName :  
  76.    function GetDataProjectionName(name:WideString):Integer;dispid 116;
  77.     // OutputMap :  
  78.    function OutputMap(hdc:OLE_HANDLE;x:Integer;y:Integer;width:Integer;height:Integer):Integer;dispid 117;
  79.     // EventHandled :  
  80.    function EventHandled:Integer;dispid 118;
  81.     // GetMapDC :  
  82.    function GetMapDC(hdc:OLE_HANDLE):Integer;dispid 119;
  83.     // ReleaseMapDC :  
  84.    function ReleaseMapDC(hdc:OLE_HANDLE):Integer;dispid 120;
  85.     // SetNextDrawMode :  
  86.    function SetNextDrawMode(mode:Integer):Integer;dispid 121;
  87.     // SetSecurityKey :  
  88.    function SetSecurityKey(filename:WideString;key:WideString):Integer;dispid 10000;
  89.     // SetRotationCenterAndAngle :  
  90.    function SetRotationCenterAndAngle(x:Double;y:Double;angle:Double):Integer;dispid 10100;
  91.     // SetLayerVisibility :  
  92.    function SetLayerVisibility(layername:WideString;value:Integer):Integer;dispid 10300;
  93.     // SetWaitCursorMode :  
  94.    function SetWaitCursorMode(value:Integer):Integer;dispid 10301;
  95.     // SetErrorHandlingMode :  
  96.    function SetErrorHandlingMode(mode:Integer):Integer;dispid 10304;
  97.     // SetLayerGroupVisibility :  
  98.    function SetLayerGroupVisibility(groupvalue:WideString;value:Integer):Integer;dispid 10305;
  99.     // SetImageQuality :  
  100.    function SetImageQuality(mode:Integer):Integer;dispid 10306;
  101.     // CreateMap :  
  102.    function CreateMap(hdc:OLE_HANDLE;dpi:Integer;Extent:IiwGeoRect;width:Integer;height:Integer):Integer;dispid 10500;
  103.     // AboutBox :  
  104.    procedure AboutBox;dispid -552;
  105.     // MapDescriptionFilename :  
  106.    property MapDescriptionFilename:WideString  dispid 1;
  107.     // FullExtent :  
  108.    property FullExtent:IiwGeoRect  dispid 2;
  109.     // Extent :  
  110.    property Extent:IiwGeoRect  dispid 3;
  111.     // Appearance :  
  112.    property Appearance:Smallint  dispid -520;
  113.     // BackColor :  
  114.    property BackColor:OLE_COLOR  dispid 4;
  115.     // BorderStyle :  
  116.    property BorderStyle:Smallint  dispid 5;
  117.     // ZoomFactor :  
  118.    property ZoomFactor:Double  dispid 6;
  119.     // Scale :  
  120.    property Scale:Integer  dispid 7;
  121.     // MouseMode :  
  122.    property MouseMode:Smallint  dispid 8;
  123.     // MapLimits :  
  124.    property MapLimits:IiwGeoRect  dispid 9;
  125.     // MapLimitMode :  
  126.    property MapLimitMode:Smallint  dispid 10;
  127.     // IdentifyRadius :  
  128.    property IdentifyRadius:Double  dispid 11;
  129.     // IdentifyRadiusUnit :  
  130.    property IdentifyRadiusUnit:Smallint  dispid 12;
  131.     // IdentifyLayerNames :  
  132.    property IdentifyLayerNames:WideString  dispid 13;
  133.     // IdentifyGetBorderPolygons :  
  134.    property IdentifyGetBorderPolygons:Smallint  dispid 14;
  135.     // RefreshCount :  
  136.    property RefreshCount:Integer  dispid 15;
  137.     // Enabled :  
  138.    property Enabled:ShortInt  dispid -514;
  139.     // BorderStyleCE :  
  140.    property BorderStyleCE:Smallint  dispid -504;
  141.   end;
  142.  
  143.  
  144. // _DiwMapViewCtrlEvents : Ereignisschnittstelle für iwMapView Control
  145.  
  146.  _DiwMapViewCtrlEvents = dispinterface
  147.    ['{764407BA-4EE6-4571-B735-B125470009DA}']
  148.     // AfterAllLayerDraw :  
  149.    procedure AfterAllLayerDraw(hdc:OLE_HANDLE);dispid 1;
  150.     // PopupMenu :  
  151.    procedure PopupMenu(hmenu:OLE_HANDLE);dispid 2;
  152.     // CustomMenuCommand :  
  153.    procedure CustomMenuCommand(menuid:Smallint;mousex:Integer;mousey:Integer);dispid 3;
  154.     // MapViewError :  
  155.    procedure MapViewError(errorcode:Smallint;errortext:WideString);dispid 4;
  156.     // FireIdentifyResult :  
  157.    procedure FireIdentifyResult(IdentifyResult:WideString);dispid 5;
  158.     // SetCursor :  
  159.    procedure SetCursor;dispid 6;
  160.     // MeasureDistance :  
  161.    procedure MeasureDistance(currSegmentLength:Double;totalLength:Double);dispid 7;
  162.     // AfterUserDraw :  
  163.    procedure AfterUserDraw(hdc:OLE_HANDLE);dispid 8;
  164.     // Progress :  
  165.    procedure Progress(statusCode:Integer;cancel:Integer);dispid 9;
  166.     // MouseDown :  
  167.    procedure MouseDown(nButton:Smallint;nShiftState:Smallint;x:Integer;y:Integer);dispid -605;
  168.     // MouseUp :  
  169.    procedure MouseUp(nButton:Smallint;nShiftState:Smallint;x:Integer;y:Integer);dispid -607;
  170.     // MouseMove :  
  171.    procedure MouseMove(nButton:Smallint;nShiftState:Smallint;x:Integer;y:Integer);dispid -606;
  172.   end;
  173.  
  174. //CoClasses
  175.   T_DiwMapViewCtrlEventsAfterAllLayerDraw = procedure(Sender: TObject;hdc:OLE_HANDLE) of object;
  176.   T_DiwMapViewCtrlEventsPopupMenu = procedure(Sender: TObject;hmenu:OLE_HANDLE) of object;
  177.   T_DiwMapViewCtrlEventsCustomMenuCommand = procedure(Sender: TObject;menuid:Smallint;mousex:Integer;mousey:Integer) of object;
  178.   T_DiwMapViewCtrlEventsMapViewError = procedure(Sender: TObject;errorcode:Smallint;errortext:WideString) of object;
  179.   T_DiwMapViewCtrlEventsFireIdentifyResult = procedure(Sender: TObject;IdentifyResult:WideString) of object;
  180.   T_DiwMapViewCtrlEventsSetCursor = procedure(Sender: TObject) of object;
  181.   T_DiwMapViewCtrlEventsMeasureDistance = procedure(Sender: TObject;currSegmentLength:Double;totalLength:Double) of object;
  182.   T_DiwMapViewCtrlEventsAfterUserDraw = procedure(Sender: TObject;hdc:OLE_HANDLE) of object;
  183.   T_DiwMapViewCtrlEventsProgress = procedure(Sender: TObject;statusCode:Integer;cancel:Integer) of object;
  184.   T_DiwMapViewCtrlEventsMouseDown = procedure(Sender: TObject;nButton:Smallint;nShiftState:Smallint;x:Integer;y:Integer) of object;
  185.   T_DiwMapViewCtrlEventsMouseUp = procedure(Sender: TObject;nButton:Smallint;nShiftState:Smallint;x:Integer;y:Integer) of object;
  186.   T_DiwMapViewCtrlEventsMouseMove = procedure(Sender: TObject;nButton:Smallint;nShiftState:Smallint;x:Integer;y:Integer) of object;
  187.  
  188.  
  189.   CoiwMapViewCtrl = Class
  190.   Public
  191.     Class Function Create: _DiwMapViewCtrl;
  192.     Class Function CreateRemote(const MachineName: string): _DiwMapViewCtrl;
  193.   end;
  194.  
  195.   TAxciwMapViewCtrl = Class(TActiveXContainer)
  196.   Private
  197.     FServer:_DiwMapViewCtrl;
  198.     FOnAfterAllLayerDraw:T_DiwMapViewCtrlEventsAfterAllLayerDraw;
  199.     FOnPopupMenu:T_DiwMapViewCtrlEventsPopupMenu;
  200.     FOnCustomMenuCommand:T_DiwMapViewCtrlEventsCustomMenuCommand;
  201.     FOnMapViewError:T_DiwMapViewCtrlEventsMapViewError;
  202.     FOnFireIdentifyResult:T_DiwMapViewCtrlEventsFireIdentifyResult;
  203.     FOnSetCursor:T_DiwMapViewCtrlEventsSetCursor;
  204.     FOnMeasureDistance:T_DiwMapViewCtrlEventsMeasureDistance;
  205.     FOnAfterUserDraw:T_DiwMapViewCtrlEventsAfterUserDraw;
  206.     FOnProgress:T_DiwMapViewCtrlEventsProgress;
  207.     FOnMouseDown:T_DiwMapViewCtrlEventsMouseDown;
  208.     FOnMouseUp:T_DiwMapViewCtrlEventsMouseUp;
  209.     FOnMouseMove:T_DiwMapViewCtrlEventsMouseMove;
  210.  
  211.     FEventSink:TEventSink;
  212.     procedure EventSinkInvoke(Sender: TObject; DispID: Integer;
  213.           const IID: TGUID; LocaleID: Integer; Flags: Word;
  214.           Params: tagDISPPARAMS; VarResult, ExcepInfo, ArgErr: Pointer);
  215.   Public
  216.     constructor Create(TheOwner: TComponent); override;
  217.     destructor Destroy; override;
  218.     property OleServer:_DiwMapViewCtrl read FServer;
  219.   Published
  220.     property Align;
  221.     property Anchors;
  222.     property AutoSize;
  223.     property BorderSpacing;
  224.     property ChildSizing;
  225.     property ClientHeight;
  226.     property ClientWidth;
  227.     property Constraints;
  228.     property DockSite;
  229.     property DragCursor;
  230.     property DragKind;
  231.     property DragMode;
  232.     property Enabled;
  233.     property ParentShowHint;
  234.     property PopupMenu;
  235.     property ShowHint;
  236.     property TabOrder;
  237.     property TabStop;
  238.     property UseDockManager default True;
  239.     property Visible;
  240.     property OnContextPopup;
  241.     property OnDockDrop;
  242.     property OnDockOver;
  243.     property OnDragDrop;
  244.     property OnDragOver;
  245.     property OnEndDock;
  246.     property OnEndDrag;
  247.     property OnEnter;
  248.     property OnExit;
  249.     property OnGetSiteInfo;
  250.     property OnGetDockCaption;
  251.     property OnResize;
  252.     property OnStartDock;
  253.     property OnStartDrag;
  254.     property OnStatusText;
  255.     property OnUnDock;
  256.     property OnAfterAllLayerDraw : T_DiwMapViewCtrlEventsAfterAllLayerDraw read FOnAfterAllLayerDraw write FOnAfterAllLayerDraw;
  257.     property OnPopupMenu : T_DiwMapViewCtrlEventsPopupMenu read FOnPopupMenu write FOnPopupMenu;
  258.     property OnCustomMenuCommand : T_DiwMapViewCtrlEventsCustomMenuCommand read FOnCustomMenuCommand write FOnCustomMenuCommand;
  259.     property OnMapViewError : T_DiwMapViewCtrlEventsMapViewError read FOnMapViewError write FOnMapViewError;
  260.     property OnFireIdentifyResult : T_DiwMapViewCtrlEventsFireIdentifyResult read FOnFireIdentifyResult write FOnFireIdentifyResult;
  261.     property OnSetCursor : T_DiwMapViewCtrlEventsSetCursor read FOnSetCursor write FOnSetCursor;
  262.     property OnMeasureDistance : T_DiwMapViewCtrlEventsMeasureDistance read FOnMeasureDistance write FOnMeasureDistance;
  263.     property OnAfterUserDraw : T_DiwMapViewCtrlEventsAfterUserDraw read FOnAfterUserDraw write FOnAfterUserDraw;
  264.     property OnProgress : T_DiwMapViewCtrlEventsProgress read FOnProgress write FOnProgress;
  265.     property OnMouseDown : T_DiwMapViewCtrlEventsMouseDown read FOnMouseDown write FOnMouseDown;
  266.     property OnMouseUp : T_DiwMapViewCtrlEventsMouseUp read FOnMouseUp write FOnMouseUp;
  267.     property OnMouseMove : T_DiwMapViewCtrlEventsMouseMove read FOnMouseMove write FOnMouseMove;
  268.  
  269.     property Active;
  270.   end;
  271.  
  272. implementation
  273.  
  274. uses comobj;
  275.  
  276. Class Function CoiwMapViewCtrl.Create: _DiwMapViewCtrl;
  277. begin
  278.   Result := CreateComObject(CLASS_iwMapViewCtrl) as _DiwMapViewCtrl;
  279. end;
  280.  
  281. Class Function CoiwMapViewCtrl.CreateRemote(const MachineName: string): _DiwMapViewCtrl;
  282. begin
  283.   Result := CreateRemoteComObject(MachineName,CLASS_iwMapViewCtrl) as _DiwMapViewCtrl;
  284. end;
  285.  
  286. constructor TAxciwMapViewCtrl.Create(TheOwner: TComponent);
  287. begin
  288.   inherited Create(TheOwner);
  289.   FServer:=CoiwMapViewCtrl.Create;
  290.   ComServer:=FServer;
  291.   FEventSink:=TEventSink.Create(Self);
  292.   FEventSink.OnInvoke:=EventSinkInvoke;
  293.   FEventSink.Connect(FServer,_DiwMapViewCtrlEvents);
  294. end;
  295.  
  296. destructor TAxciwMapViewCtrl.Destroy;
  297. begin
  298.   FEventSink.Destroy;
  299.   inherited destroy;
  300. end;
  301.  
  302. procedure TAxciwMapViewCtrl.EventSinkInvoke(Sender: TObject; DispID: Integer;
  303.   const IID: TGUID; LocaleID: Integer; Flags: Word; Params: tagDISPPARAMS;
  304.   VarResult, ExcepInfo, ArgErr: Pointer);
  305. begin
  306.   case DispID of
  307.     1: if assigned(OnAfterAllLayerDraw) then
  308.           OnAfterAllLayerDraw(Self, OleVariant(Params.rgvarg[0]));
  309.     2: if assigned(OnPopupMenu) then
  310.           OnPopupMenu(Self, OleVariant(Params.rgvarg[0]));
  311.     3: if assigned(OnCustomMenuCommand) then
  312.           OnCustomMenuCommand(Self, OleVariant(Params.rgvarg[2]), OleVariant(Params.rgvarg[1]), OleVariant(Params.rgvarg[0]));
  313.     4: if assigned(OnMapViewError) then
  314.           OnMapViewError(Self, OleVariant(Params.rgvarg[1]), OleVariant(Params.rgvarg[0]));
  315.     5: if assigned(OnFireIdentifyResult) then
  316.           OnFireIdentifyResult(Self, OleVariant(Params.rgvarg[0]));
  317.     6: if assigned(OnSetCursor) then
  318.           OnSetCursor(Self);
  319.     7: if assigned(OnMeasureDistance) then
  320.           OnMeasureDistance(Self, OleVariant(Params.rgvarg[1]), OleVariant(Params.rgvarg[0]));
  321.     8: if assigned(OnAfterUserDraw) then
  322.           OnAfterUserDraw(Self, OleVariant(Params.rgvarg[0]));
  323.     9: if assigned(OnProgress) then
  324.           OnProgress(Self, OleVariant(Params.rgvarg[1]), Params.rgvarg[0].plVal^);
  325.     -605: if assigned(OnMouseDown) then
  326.           OnMouseDown(Self, OleVariant(Params.rgvarg[3]), OleVariant(Params.rgvarg[2]), OleVariant(Params.rgvarg[1]), OleVariant(Params.rgvarg[0]));
  327.     -607: if assigned(OnMouseUp) then
  328.           OnMouseUp(Self, OleVariant(Params.rgvarg[3]), OleVariant(Params.rgvarg[2]), OleVariant(Params.rgvarg[1]), OleVariant(Params.rgvarg[0]));
  329.     -606: if assigned(OnMouseMove) then
  330.           OnMouseMove(Self, OleVariant(Params.rgvarg[3]), OleVariant(Params.rgvarg[2]), OleVariant(Params.rgvarg[1]), OleVariant(Params.rgvarg[0]));
  331.  
  332.   end;
  333. end;
  334.  
  335. end.
  336.  


So does anyone has an idea? I don't want to build a wrapper in Delphi, only to bind to this control.

marcov

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 7589
Re: Strange Problem with an OCX Control
« Reply #3 on: May 30, 2017, 08:41:51 pm »
Did you try 64-bit ? FPC 64-bit supports SEH, 32-bit needs a recompile for that:

-dTEST_WIN32_SEH

JochenKauz

  • New Member
  • *
  • Posts: 13
Re: Strange Problem with an OCX Control
« Reply #4 on: May 30, 2017, 09:19:32 pm »
Not really.
I had installed Lazarus 64Bit and tried to cross compile for 32.
But I was not able to import the library, the recompile of the IDE always crashed, so I switched to the 32Bit Lazarus version.

You think I should give the 64Bit version a chance, import the generated components of Mapview and crosscompile for 32Bit? Or compile the fpc 32Bit with that option?
« Last Edit: May 30, 2017, 09:35:00 pm by JochenKauz »

marcov

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 7589
Re: Strange Problem with an OCX Control
« Reply #5 on: May 30, 2017, 09:45:37 pm »
Either make a 64-bit application, or recompile everything with that option

JochenKauz

  • New Member
  • *
  • Posts: 13
Re: Strange Problem with an OCX Control
« Reply #6 on: May 30, 2017, 10:07:47 pm »
Really sorry for that dumb question, but I'm new to the Lazarus project and FPC.
How can I recompile all with that option? I looked at the compiler options in Lazarus and did not find the right way.

JochenKauz

  • New Member
  • *
  • Posts: 13
Re: Strange Problem with an OCX Control
« Reply #7 on: May 30, 2017, 10:11:28 pm »
Really sorry for that dumb question, but I'm new to the Lazarus project and FPC.
How can I recompile all with that option? I looked at the compiler options in Lazarus and did not find the right way.
Ok.. I think I found the way.. I give it a try

JochenKauz

  • New Member
  • *
  • Posts: 13
Re: Strange Problem with an OCX Control
« Reply #8 on: May 30, 2017, 10:15:34 pm »
Hmm.. perhaps I took the wrong way.
I added the option to the Lazarus compile options and started a recompile.

Update:
Compile finished, but then I get a Lazarus IDE is not functioning correctly, and Windows close Lazarus IDE.
« Last Edit: May 30, 2017, 10:18:12 pm by JochenKauz »

avra

  • Hero Member
  • *****
  • Posts: 1731
    • Additional info
Re: Strange Problem with an OCX Control
« Reply #9 on: May 31, 2017, 09:21:10 am »
ct2laz - Conversion between Lazarus and CodeTyphon
bithelpers - Bit manipulation for standard types
pasettimino - Siemens S7 PLC lib

JochenKauz

  • New Member
  • *
  • Posts: 13
Re: Strange Problem with an OCX Control
« Reply #10 on: May 31, 2017, 01:57:24 pm »
Unfortunately that is not an option.
I must use the new component, cause in this component is not only map viewing included, instead there are much more features in it, like routing, optimizing of routes, etc.

I switched to fpcup now to build Lazarus and the FPC from scratch, perhaps I can solve this problem with a newer version.

But nevertheless it is a strange problem, that I'm not able to communicate with this OCX, even on low level.

Thaddy

  • Hero Member
  • *****
  • Posts: 9278
Re: Strange Problem with an OCX Control
« Reply #11 on: May 31, 2017, 03:30:05 pm »
Jochen,

Plz let us know:

WHEN was this OCX build/made and WHEN was it purchased? It is OLD software.... We can't fix modern code if your starting point is a piece of shit.

What we have, right know, in the FPC community, as standard, is a complete interface to Google Maps..... Which is better easier and, well,...

For the past 5 years, people even trying to build an OCX got (virtually.. just not in real life) shot. Pushing up daisies, ex-parrot, gone to meet its maker,
See https://www.youtube.com/watch?v=Oj8RIEQH7zA
« Last Edit: May 31, 2017, 03:34:33 pm by Thaddy »
also related to equus asinus.

JochenKauz

  • New Member
  • *
  • Posts: 13
Re: Strange Problem with an OCX Control
« Reply #12 on: May 31, 2017, 04:31:30 pm »
It was purchased 2 month ago, and the used OCX was build for me yesterday (I asked the company for a fresh build that has a normal dispinterface, not a hidden dispinterface).

It is a specialized component package for building navigation and routing software for trucks.
The features I want to implement are not buildable with Google Maps.
The database on which the maps are build and routing occurs, include specific truck informations of roads, bridges, towns, etc.
But if anyone is interested what this components really do, and for what this is needed:
https://www.infoware.de/en/gps-navigation/mapsuite-map-server/

This OCX controls work with Delphi 10.1 Berlin, Visual Studio C++, C#, etc. Only FPC does not work.

I recompiled the test project with -dTEST_WIN32_SEH, but nothing changed, it crashes.

This is the call stack at crash time (DTB posted earlier):
#0 fpc_raiseexception at :0
#1 COMOBJ_$$_DISPATCHINVOKEERROR$HRESULT$TAGEXCEPINFO at :0
#2 COMOBJ_$$_DISPATCHINVOKE$IDISPATCH$PCALLDESC$PDISPIDLIST$POINTER$PVARIANT at :0
#3 fpc_dispatch_by_id at :0
#4 TFRMAP__FORMCREATE(0x1ac01b0, <error reading variable>) at Map.pas:93
#5 FORMS$_$TCUSTOMFORM_$__$$_DOCREATE at :0
#6 FORMS$_$TCUSTOMFORM_$__$$_AFTERCONSTRUCTION at :0
#7 FORMS$_$TFORM_$__$$_CREATE$TCOMPONENT$$TFORM at :0
#8 FORMS$_$TAPPLICATION_$__$$_CREATEFORM$TCOMPONENTCLASS$formal at :0
#9 main at InfowareDemo.lpr:17

Map.pas line 93:
  showmessage(iwMapViewCtrl1.OleServer.MapDescriptionFilename);
« Last Edit: May 31, 2017, 04:33:35 pm by JochenKauz »

Thaddy

  • Hero Member
  • *****
  • Posts: 9278
Re: Strange Problem with an OCX Control
« Reply #13 on: May 31, 2017, 07:15:32 pm »
Ok. Let's do this in a private conversation. I might be able to help. (does not cost money..but time..)
« Last Edit: May 31, 2017, 07:19:24 pm by Thaddy »
also related to equus asinus.

JochenKauz

  • New Member
  • *
  • Posts: 13
Re: Strange Problem with an OCX Control
« Reply #14 on: May 31, 2017, 07:57:36 pm »
Hi Thaddy,
that would be really nice. How?