一个ISAPI的数据传递问题(100分)

  • 主题发起人 主题发起人 chenzhou
  • 开始时间 开始时间
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>
 
现在是想让 ASP 传递一个参数给 DELPHI ,
当然如果用表单的ACTION提交我是知道怎么做的。

还有就是这个DELPHI程序怎么返回一个变量的值给ASP网页。
让网页判断 if delphiaspobj.ok then .... else end if
 
接受答案了.
 
后退
顶部