下面是我的源代码:
unit uMyAgent;
{$WARN SYMBOL_PLATFORM OFF}
interface
uses
ComObj, ActiveX, MyAgentServer_TLB,AgentObjects_TLB, StdVcl;
type
TMyAgentObj = class(TAutoObject, IMyAgentObj)
private
My_Agent:IagentCtlEx;
protected
procedure LoadIt
safecall;
procedure OnStartPage(const MyAgent: IUnknown)
safecall;
{ Protected declarations }
end;
implementation
uses ComServ;
procedure TMyAgentObj.LoadIt;
var
Peedy: IagentCtlCharacter;
Request: IagentCtlRequest;
begin
request:=my_agent.Characters.Load('peedy','offcat.acs');
peedy:=my_agent.Characters.Character('peedy');
peedy.Show(0);
end;
procedure TMyAgentObj.OnStartPage(const MyAgent: IUnknown);
begin
My_Agent:=MyAgent as IagentCtlEx;
end;
initialization
TAutoObjectFactory.Create(ComServer, TMyAgentObj, Class_MyAgentObj,
ciMultiInstance, tmApartment);
end.