C
chenzhou
Unregistered / Unconfirmed
GUEST, unregistred user!
unit1.pas
unit Unit1;
{$WARN SYMBOL_PLATFORM OFF}
interface
uses
ComObj, ActiveX, AspTlb, iff_TLB, StdVcl,SysUtils;
type
Tfff = class(TASPObject, Ifff)
protected
procedure OnEndPage; safecall;
procedure OnStartPage(const AScriptingContext: IUnknown); safecall;
procedure test1(qa: PWideChar); safecall; //关键是这个地方
end;
implementation
uses ComServ;
procedure Tfff.OnEndPage;
begin
inherited OnEndPage;
end;
procedure Tfff.OnStartPage(const AScriptingContext: IUnknown);
begin
inherited OnStartPage(AScriptingContext);
end;
procedure Tfff.test1(qa: PWideChar); //关键是这个地方
var i : string;
begin
i:=WideCharToString(qa);
response.write(i);
end;
initialization
TAutoObjectFactory.Create(ComServer, Tfff, Class_fff,
ciMultiInstance, tmApartment);
end.
fff.asp
<HTML>
<BODY>
<TITLE> Testing Delphi ASP </TITLE>
<CENTER>
<H3> You should see the results of your Delphi Active Server method below </H3>
</CENTER>
<HR>
<% response.write now()
Set DelphiASPObj = Server.CreateObject("iff.fff")
delphiaspobj.test1("aabbcc")
' delphiaspobj=nothings
%>
<HR>
</BODY>
</HTML>
unit Unit1;
{$WARN SYMBOL_PLATFORM OFF}
interface
uses
ComObj, ActiveX, AspTlb, iff_TLB, StdVcl,SysUtils;
type
Tfff = class(TASPObject, Ifff)
protected
procedure OnEndPage; safecall;
procedure OnStartPage(const AScriptingContext: IUnknown); safecall;
procedure test1(qa: PWideChar); safecall; //关键是这个地方
end;
implementation
uses ComServ;
procedure Tfff.OnEndPage;
begin
inherited OnEndPage;
end;
procedure Tfff.OnStartPage(const AScriptingContext: IUnknown);
begin
inherited OnStartPage(AScriptingContext);
end;
procedure Tfff.test1(qa: PWideChar); //关键是这个地方
var i : string;
begin
i:=WideCharToString(qa);
response.write(i);
end;
initialization
TAutoObjectFactory.Create(ComServer, Tfff, Class_fff,
ciMultiInstance, tmApartment);
end.
fff.asp
<HTML>
<BODY>
<TITLE> Testing Delphi ASP </TITLE>
<CENTER>
<H3> You should see the results of your Delphi Active Server method below </H3>
</CENTER>
<HR>
<% response.write now()
Set DelphiASPObj = Server.CreateObject("iff.fff")
delphiaspobj.test1("aabbcc")
' delphiaspobj=nothings
%>
<HR>
</BODY>
</HTML>