在线程中调用AGENT报错,各位来看看我那个地方错了! (40分)

  • 主题发起人 主题发起人 solin
  • 开始时间 开始时间
S

solin

Unregistered / Unconfirmed
GUEST, unregistred user!
UNIT ThTips;

INTERFACE

USES
Classes, AgentObjects_TLB, SysUtils, Forms;

TYPE
Thread_Tips = CLASS(TThread)
Agent_Genie: TAgent;
PROCEDURE ShowTips;
Private
{ Private declarations }
Protected
PROCEDURE Execute
Override;
END;

VAR
Agent_Request: IagentCtlRequest;
Agent_Tips: IagentCtlCharacter;

IMPLEMENTATION

{ Important: Methods and properties of objects in VCL or CLX can only be used
in a method called using Synchronize, for example,

Synchronize(UpdateCaption);

and UpdateCaption could look like,

procedure Thread_Tips.UpdateCaption;
begin
Form1.Caption := 'Updated in a thread';
end
}

{ Thread_Tips }

PROCEDURE Thread_Tips.ShowTips;
BEGIN
Agent_Request := Agent_Genie.Characters.Load('genie',
extractfilepath(application.exename) + '/genie.acs')
//在这行报错
Agent_Tips := Agent_Genie.Characters.Character('genie');
Agent_Tips.Show(0);
Agent_Tips.Speak('TEST', '');
Agent_Tips.Hide(0);
END;

PROCEDURE Thread_Tips.Execute;
BEGIN
ShowTips;
END;

END.

 
up一下!!!
 
如果我要动态创建AGENT[AGENT.CREATE(AOWNER: TComponent)],其中的AOWNER该是什么(在线程中)
 
后退
顶部