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.
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.