Before you can use the Agent in Powerbuilder, you need to download Microsoft Agent from Microsoft Agent site and install it into your computer. There 2 cores that you must download, one is Microsoft Agent core component, and the other is the Agent Character, which have 4 characters officially from Microsoft.
In this sample, I use Peedy, a green talking bird as a character
The next step is try to insert OLE Object at Powerbuilder's windows object. Choose the Microsoft Agent 2.0 from the Insert Control Tab.
Add Microsoft Agent Control 2.0 from the list |
Agent OLE Object after inserted |
// set the agent, and named as Clippit
ole_1.Object.Characters.Load("Clippit","c:\windows\msagent\chars\peedy.acs")
// show the Clippit
ole_1.Object.Characters("Clippit").Show
// move the Clippit to position 400,200
ole_1.Object.Characters("Clippit").MoveTo(400,200)
ole_1.Object.Characters("Clippit").MoveTo(400,200)
// ask Clippit to play animation Greeting
ole_1.Object.Characters("Clippit").Play("Greet")
ole_1.Object.Characters("Clippit").Play("Greet")
ole_1.Object.Characters("Clippit").Speak("Hello World !!! I am Peedy !!! Called by Powerbuilder !!!")
If you have a speaker (and I bet you have), you can hear the voice speaking from Character.
Run the script, and you will get like this image
There's many build in functions in Agent character, and also many third party characters which you can find at Microsoft Agent's ring.
You can learn more about the functions and properties at Microsoft Agent official site, including the guidelines if you want to create your own character.
Of course, if you want to deploy your Powerbuilder applications with Microsoft Agent object, you also need to install Microsoft Agent cores at the PC Client.
Gan, object Microsoft Agent Control 2.0 ini sumber nya dari mana?
ReplyDeleteDari ms office bukan?
Ane pake ms office 2007 gak ada tuh..
Apa ada installer khusus buat ms agent control tsb?
Thanksss...