Recent

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

Thaddy

  • Hero Member
  • *****
  • Posts: 9293
Re: Strange Problem with an OCX Control
« Reply #15 on: May 31, 2017, 08:54:56 pm »
make the message private or figure out my email address,which is simply my real name @ my real name dot com/nl/org. Thaddy is my real name... I am too old to have knick names..
also related to equus asinus.

RAW

  • Hero Member
  • *****
  • Posts: 794
Re: Strange Problem with an OCX Control
« Reply #16 on: June 01, 2017, 12:49:17 am »
Some say that name comes from the old greeks and means something like "Gift Of God"... maybe they got it wrong and it means "Gift Of Code" ... :P
Windows 7 Pro (x64 Sp1) And Windows XP Pro (x86 Sp3) - LAZARUS 2.0.4 FPC 3.0.4 - TRUNK 2.1.0 FPC 3.3.1

JochenKauz

  • New Member
  • *
  • Posts: 13
Re: Strange Problem with an OCX Control
« Reply #17 on: June 01, 2017, 10:05:48 pm »
ok, one step further..

As I thought there is perhaps a problem in the generated DTB.
As you can see in the DTB I posted, this OCX has only a dispinterface, no interface.

Codetools completion did always throw an exception (default dispinterface ancestor IDispatch not found), if I use it on iwMapViewCtrl1.OleServer. This exception is raised from "components\codetools\finddeclarationtool.pas".
I changed this in the DTB:
Code: Pascal  [Select]
  1. Type
  2.  _DiwMapViewCtrl = dispinterface;
  3.  _DiwMapViewCtrlEvents = dispinterface;
  4. //Map CoClass to its default interface
  5.  iwMapViewCtrl = _DiwMapViewCtrl;
  6. //records, unions, aliases
  7. //interface declarations
  8. // _DiwMapViewCtrl : Dispatch-Schnittstelle für iwMapView Control
  9. _DiwMapViewCtrl = interface(IDispatch)
  10.    ['{357CEE48-2FD4-4311-9E92-1050A4429D8C}']
  11.     // ZoomIn :  
  12.    function ZoomIn:Integer;dispid 101;
  13. ...
  14.  

to this:
Code: Pascal  [Select]
  1. Type
  2.  _DiwMapViewCtrl = interface;
  3.  _DiwMapViewCtrlDisp = dispinterface;
  4.  _DiwMapViewCtrlEvents = dispinterface;
  5. //Map CoClass to its default interface
  6.  iwMapViewCtrl = _DiwMapViewCtrl;
  7. //records, unions, aliases
  8. //interface declarations
  9. // _DiwMapViewCtrl : Dispatch-Schnittstelle für iwMapView Control
  10. _DiwMapViewCtrl = interface(IDispatch)
  11.    ['{357CEE48-2FD4-4311-9E92-1050A4429D8C}']
  12.   end;
  13.  
  14. _DiwMapViewCtrlDisp = dispinterface
  15.    ['{357CEE48-2FD4-4311-9E92-1050A4429D8C}']
  16.     // ZoomIn :  
  17.    function ZoomIn:Integer;dispid 101;
  18. ...

With this change codetools did not throw an exception and display all function/procedure/property correct.

But after the compile it always throws an EOLeSysError, if I access a property.

So I have to asked this question again. Does Lazarus/FPC support OCX Controls with dispinterface only?
« Last Edit: June 03, 2017, 09:14:36 pm by JochenKauz »