Recent

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

Thaddy

  • Hero Member
  • *****
  • Posts: 14381
  • Sensorship about opinions does not belong here.
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..
Object Pascal programmers should get rid of their "component fetish" especially with the non-visuals.

RAW

  • Hero Member
  • *****
  • Posts: 868
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) & Windows XP Pro (x86 Sp3).

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 »

 

TinyPortal © 2005-2018