使用MSAgent的问题 |
尚未結案
|
byzz
一般會員 發表:1 回覆:0 積分:0 註冊:2005-12-09 發送簡訊給我 |
小弟在使用MsAgent编程时,遇到一个难题请高手指点。
调用MsAgent的Command事件不知该如何操作,找到了对应的VB程序但不知怎么转换。
VB程序代码:
Private Sub MyAgent_Command(ByVal UserInput As Object)
Select Case UserInput.Name
Case "Time"
' 当 听 到"What time is it?" 后 回 答 当 前 时 间
Genie.Speak "The time is " & Time
Case "Word"
' 当 听 到"word" 后, 便 运 行MS Word
Genie.Speak "Yes,sir!"
Shell "d:\winword\winword.exe", vbNormalFocus
Case "Bigger"
' 当 听 到"bigger" 后,Genie 会 放 大
Genie.Width = Genie.Width * 1.5
Genie.Height = Genie.Height * 1.5
Case "Smaller"
' 当 听 到"samller" 后,Genie 会 缩 小
Genie.Width = Genie.Width / 1.5
Genie.Height = Genie.Height / 1.5
End Select
End Sub delphi中也有对应的事件:
procedure TForm1.MsAgentCommand(ASender: TObject;
const UserInput: IDispatch);
begin
end;
关键是对UserInput参数不理解。
發表人 - byzz 於 2005/12/09 10:14:53 |
本站聲明 |
1. 本論壇為無營利行為之開放平台,所有文章都是由網友自行張貼,如牽涉到法律糾紛一切與本站無關。 2. 假如網友發表之內容涉及侵權,而損及您的利益,請立即通知版主刪除。 3. 請勿批評中華民國元首及政府或批評各政黨,是藍是綠本站無權干涉,但這裡不是政治性論壇! |