关于ActiveX控件 ( 积分: 0 )

  • 主题发起人 主题发起人 hongw21
  • 开始时间 开始时间
H

hongw21

Unregistered / Unconfirmed
GUEST, unregistred user!
我用Delphi写了个ActiveX控件,有个方法利用OleVariant传入TMemoryStream类型的参数如下,我的问题是 1、我这样传入TMemoryStream类型的参数是否正确,2、如何在JavaScript中调用

procedure TWfUrgeX.ShowWf(WfStream: OleVariant);
var AStream : TMemoryStream;
p:pointer;

begin
AStream := TMemoryStream.Create;

try
Chart.BeginUpdate;
Chart.Clear;
p := VarArrayLock(WfStream);
AStream.Write(p^, VarArrayHighBound(WfStream,1) + 1);
AStream.Position := 0;

Chart.LoadFromStream(AStream);

Chart.EndUpdate;
finally
VarArrayUnlock(WfStream);
AStream.Free;
end;


end;
 
我用Delphi写了个ActiveX控件,有个方法利用OleVariant传入TMemoryStream类型的参数如下,我的问题是 1、我这样传入TMemoryStream类型的参数是否正确,2、如何在JavaScript中调用

procedure TWfUrgeX.ShowWf(WfStream: OleVariant);
var AStream : TMemoryStream;
p:pointer;

begin
AStream := TMemoryStream.Create;

try
Chart.BeginUpdate;
Chart.Clear;
p := VarArrayLock(WfStream);
AStream.Write(p^, VarArrayHighBound(WfStream,1) + 1);
AStream.Position := 0;

Chart.LoadFromStream(AStream);

Chart.EndUpdate;
finally
VarArrayUnlock(WfStream);
AStream.Free;
end;


end;
 

Similar threads

S
回复
0
查看
1K
SUNSTONE的Delphi笔记
S
S
回复
0
查看
922
SUNSTONE的Delphi笔记
S
S
回复
0
查看
758
SUNSTONE的Delphi笔记
S
后退
顶部