Article View: comp.lang.pascal.delphi.components.writing
Article #9[Q] How can I make a script safe ActiveX Control?
From: M.Ish
Date: Mon, 10 Nov 1997 00:00
Date: Mon, 10 Nov 1997 00:00
104 lines
3509 bytes
3509 bytes
Hello
I have been trying to make an ActiveX Control to be used on a WEB Page.
And I face some problems.
1. I would like to control the ActiveX control with JavaScript.
But an ActiveX Control converted from VCL is not script safe. So,
it is rejected unless I lower the security level of my browser.
How can I make an ActiveX control that is script safe?
2. An ActiveX control made with Delphi3 does not seem to understand
the <PARAM> tag in an HTML file. All the information of parameters are
encoded into DATA=... part within <Object> tag.
Is there any way to have it understand <PARAM> tag?
3. Is it possible to make an ActiveX control without window handle? (
something like preloader at MS's WEB page.)
4. The ActiveX control made from the following code works fine on
Delphi, MSIE and VB, but not exactly on ActiveX Control Pad.
(You can see the ActiveX control at
http://www.solution.co.jp/ac/ishii/AXtest/
if you lower the security level of your browser.)
The Paint method is called and a circle is drawn only when
the Paint event is called from windows (for example, when
the control is resized (maybe when Invalidate is called) ).
If I replace the "Sendmessage(...)" with "Invalidate", it works on
ActiveX control Pad, but then it starts blinking.
Could anyone tell me why this happens and how I can solve this problem?
Thanks in advance
---- Code of the Control in item4------
unit testpaint;
interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
ExtCtrls;
type
Ttestpaint = class(TCustomPanel)
private
i: integer;
mytimer: TTimer;
procedure PaintEvent(Sender:TObject);
{Private}
protected
{Protected}
public
constructor Create(Owner:Tcomponent); override;
destructor Destroy; override;
procedure Paint; override;
{Public}
published
{Published}
end;
procedure Register;
implementation
constructor TtestPaint.Create(Owner:Tcomponent);
begin
inherited Create(Owner);
mytimer:=TTimer.Create(self);
mytimer.interval:=1000;
mytimer.OnTimer:=PaintEvent;
i:=20;
end;
destructor Ttestpaint.Destroy;
begin
mytimer.free;
inherited Destroy;
end;
procedure Ttestpaint.PaintEvent(Sender:TObject);
begin
// If I replace the following line with "Invalidate",
//it works on ActiveX Control Pad.
// But then, it starts blinking.
SendMessage(Handle,Wm_Paint,Canvas.Handle,0);
end;
procedure Ttestpaint.Paint;
begin
canvas.ellipse(0,0,i,i);
i:=(i+20) mod 200;
end;
procedure Register;
begin
RegisterComponents('Samples', [Ttestpaint]);
end;
end.
Technical Details
Message-ID:
<3467179B.102@sakura.kudpc.kyoto-u.ac.jp>Path:
arc1-ca.pugleaf.net!unknown!not-for-mailShow Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: f5214,89810db6b1c520b2,start X-Google-Attributes: gidf5214,public X-Google-Thread: 109d99,89810db6b1c520b2,start X-Google-Attributes: gid109d99,public X-Google-Thread: fe2ce,89810db6b1c520b2,start X-Google-Attributes: gidfe2ce,public X-Google-Thread: 10baee,89810db6b1c520b2,start X-Google-Attributes: gid10baee,public From: "M.Ish" <l50679@sakura.kudpc.kyoto-u.ac.jp> Subject: [Q] How can I make a script safe ActiveX Control? Date: 1997/11/10 Message-ID: <3467179B.102@sakura.kudpc.kyoto-u.ac.jp> X-Deja-AN: 288331328 Organization: Dept. of Information Science, Kyoto University, JAPAN Newsgroups: comp.lang.pascal.delphi.components.writing,comp.lang.pascal.delphi.misc,comp.lang.pascal.delphi.components.misc,borland.public.delphi.activex.controls.writing