Quantcast
Channel: Embarcadero Community - Embarcadero Community
Viewing all articles
Browse latest Browse all 1963

How to call activex method from javascript

$
0
0

I have issue with delphi activex control. I create acitvex library and then activex form. I define one function and i want to call this function from javascript. But i can't javascript trow error "Object doesn't support property or method 'Method1'".

This is HTML code:


    

This is delphi code *.ridl file

interface IGetDocs: IDispatch
{
    [id(0x000000E8)]
    HRESULT _stdcall Method1(void);
};

this is *_TLB.pas file

IGetDocs = interface(IDispatch)
    ['{8F2BF1C6-98A5-4D6B-A43E-890698A3C91D}']
    procedure Method1; safecall;
end;

and this is file with implementation

unit GetDocsU;
{$WARN SYMBOL_PLATFORM OFF}
interface
uses
    Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
    ActiveX, AxCtrls, GetDocs_TLB, StdVcl, Vcl.StdCtrls, ShellApi, Vcl.XPMan,
    IdBaseComponent, IdComponent, IdTCPConnection, IdTCPClient, IdHTTP;

type
    TGetDocs = class(TActiveForm, IGetDocs)
protected
     procedure Method1; safecall;
public
    { Public declarations }
     procedure Initialize; override;
end;

implementation

uses ComObj, ComServ;
{$R *.DFM}
procedure TGetDocs.Method1;

begin
       MessageDlg('HI from active x', mtInformation, [mbOK], 0, mbOK);
end;

end.

This is javascript:


 

Can anyone help with this issue. I try to move method in public section in published section without success. I try also to register activex control with regsvr32 and from delphi IDE but got same error


Viewing all articles
Browse latest Browse all 1963

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>