很简单阿,关于创建ASP控件(基础问题)请各位帮忙!!(100分)

P

popboy

Unregistered / Unconfirmed
GUEST, unregistred user!
Delphi 代码:


type
TSoftSocket = class(TASPObject, ISoftSocket)
Ssocket: TSocketConnection ;
protected
procedure OnEndPage; safecall;
procedure OnStartPage(const AScriptingContext: IUnknown); safecall;
procedure SendMsg(Shost: PWideChar; Sport: SYSINT; Smsg: PWideChar); safecall;
end;

implementation

uses ComServ;

procedure TSoftSocket.OnEndPage;
begin
inherited OnEndPage;
end;

procedure TSoftSocket.OnStartPage(const AScriptingContext: IUnknown);
begin
inherited OnStartPage(AScriptingContext);
end;
procedure TSoftSocket.SendMsg(Shost: PWideChar; Sport: SYSINT;
Smsg: PWideChar); safecall;
begin
//Ssocket.Host := Shost ;
//Ssocket.Port := Sport;
response.write('<B><font size=6 color=red>Now OK!!</font></B>');
//Ssocket.Connected := true;

end;

initialization
TAutoObjectFactory.Create(ComServer, TSoftSocket, Class_SoftSocket,
ciMultiInstance, tmApartment);


end.

ASP 代码:
Set DelphiASPObj = Server.CreateObject("Psocket.SoftSocket")
DelphiASPObj.SendMsg "192.168.3.29" ,4321 , "OK"


错误提示:

Microsoft VBScript 运行时错误 错误 '800a01ca'

变量使用了一个 VBScript 中不支持的 Automation 类型: 'SendMsg'

/2.asp,行 9


请各位帮忙!!
 
谁有个简单的创建ASP控件例子请发给我

jerry_xi@hotmail.com
 
我有个发邮件的,自己写的,晚上发给你!
 
还有,为什么你不用wideString类型啊,最好不要自己定义 !
Sport用直接用integer得了!
 
wideString;integer这些类型都用不了啊!!

对,我做了一个没有参数的方法可以用了,是好的。
 
怎么不能用?
我怎么用的了你却用不了!
 
不知道啊!

你发过来离子我看一下!

我现在使用session 来完成delphi和ASp传递参数,呵呵
 
顶部