用delphi为asp写dll的问题非熟悉都未入
ttt2 2003-08-22 06:46:47 用delphi建立一个dll都没问题就是不知道如用在作法时如何加进参数(in,out)在asp里老提示类型不对,还有如何作function向asp里传值下面有一个 check的function但在asp里不让调动出刹求求各位高手这个问题困扰了我好久
unit Unit1;
{$WARN SYMBOL_PLATFORM OFF}
interface
uses
ComObj, ActiveX, Project1_TLB, StdVcl,ASPTypeLibrary_TLB;
type
Thhh = class(TAutoObject, Ihhh)
private
m_scriptContext:IScriptingContext;
protected
procedure onpageend; safecall;
procedure onpagestart(const unk: IUnknown); safecall;
procedure test(value1: SYSINT); safecall;
function check:olevariant; safecall;
{ Protected declarations }
end;
implementation
uses ComServ ;
function Thhh.check():olevariant;
begin
result:='aaa';
end;
procedure Thhh.onpageend;
begin
m_scriptContext := nil;
end;
procedure Thhh.onpagestart(const unk: IUnknown);
begin
m_scriptContext := unk as IScriptingContext;
end;
procedure Thhh.test(value1: SYSINT);
begin
m_scriptContext.Response.Write(value1);
end;
initialization
TAutoObjectFactory.Create(ComServer, Thhh, Class_hhh,
ciMultiInstance, tmApartment);
end.