ActiveX™ Technology for Interactive Software Agents icon

ActiveX™ Technology for Interactive Software Agents




Скачати 441.49 Kb.
НазваActiveX™ Technology for Interactive Software Agents
Сторінка1/11
Дата20.09.2012
Розмір441.49 Kb.
ТипДокументи
  1   2   3   4   5   6   7   8   9   10   11

Programming the Microsoft Agent Control

ActiveX™ Technology for Interactive Software Agents




Last updated: November 1997
Microsoft Corporation

Note: This document is provided for informational purposes only and Microsoft makes no warranties, either expressed or implied, in this document. The entire risk of the use or the results of this document remains with the user.

Information in this document is subject to change without notice. Companies, names, and data used in examples herein are fictitious unless otherwise noted. No part of this document may be reproduced or transmitted in any form or by any means, electronic or mechanical, for any purpose, without the express written permission of Microsoft Corporation.

Microsoft may have patents or pending patent applications, trademarks, copyrights, or other intellectual property rights covering subject matter in this document. The furnishing of this document does not give you any license to these patents, trademarks, copyrights, or other intellectual property rights. Microsoft, MS, MS-DOS, Windows, Windows NT, and the Windows logo are either registered trademarks or trademarks of Microsoft Corporation in the U.S. and/or other countries. Other product and company names mentioned herein may be the trademarks of their respective owners.


Contents

Introduction
Document Conventions
Accessing the Control in Web Pages
Accessing the Control from Visual Basic and Other Programming Languages
Accessing Microsoft Agent Services Directly
The Request Object
The Agent Control
The Characters Object
The AudioOutput Object
The SpeechInput Object
The CommandsWindow Object
The PropertySheet Object

Introduction


Although applications can write directly to the Microsoft Agent services using its automation server interfaces, Microsoft Agent also includes an ActiveX™ (OLE) control. The control supports easy programming using a scripting language such as Microsoft® Visual Basic® Scripting Edition (VBScript) or other languages that support the ActiveX control interface.
^

Document Conventions


This documentation uses the following typographical conventions:


Convention

Description

^ Sub, Visible, Caption

Words in bold with initial letter capitalized indicate keywords.

agent, String, Now

Italic words indicate placeholders for information you supply.

^ ENTER, F1

Words in all capital letters indicate filenames, key names, and key sequences.

Agent1.Commands.Enabled = True

Words in this font indicate code samples.

‘ This is a comment

An apostrophe (‘) indicates a code comment.

Agent1.Commands.Add "Test1", _
"Test 1", "test one"

A space and an underscore (_) continues a line of code.

[words or expression]

Items inside square brackets are optional.

This | That

A vertical bar indicates a choice between two or more items.

agent

The word "agent" in italics represents the name of the agent control you use.

The descriptions of programming interfaces in this document follow the conventions for Microsoft VBScript. However, they should be generally applicable to other languages as well.
^

Accessing the Control in Web Pages


To access the Microsoft Agent services from a Web page, use the HTML tag within the or element of the page, specifying the Microsoft CLSID (class identifier) for the control. In addition, use a CODEBASE parameter to specify the location of the Microsoft Agent installation file and its version number. The following example illustrates how to use the CODEBASE parameter to autodownload the English language version 1.5 of Microsoft Agent. For information about the current location of the Microsoft Agent installation file for specific language versions and the current release number available, see the Microsoft Agent download page (http://www.microsoft.com/workshop/prog/agent/agentdl.htm).


classid="clsid:F5BE8BD2-7DE6-11D0-91FE-00C04FD701A5"

CODEBASE = "http://activex.microsoft.com/controls/agent/MSagent.exe#VERSION=1,5,0,0"

id=Agent

>



Before any script on the page can access its services, Microsoft Agent must be installed on the system loading the page. If Microsoft Agent is not installed on the target system, Microsoft Internet Explorer will automatically download the Microsoft Agent server, data provider, and ActiveX control and ask the user whether to proceed with installation. Once installed, these three items do not have to be reinstalled unless the user uninstalls them. To begin using a character, you must also download its data using the Load and Get methods. For more information about the syntax for loading a character, see the Load method.

Note that you can also use the methods, properties, and events exposed by the browser to program the character; for example, to program its reaction to a button click. Consult the documentation for your browser to determine what features it exposes in its scripting model. For the Microsoft Internet Explorer, see the Scripting Object Model.

Supporting Microsoft Agent from a Web page requires Microsoft Internet Explorer version 3.0 or later. For other browsers, contact the supplier for information regarding their support for ActiveX.
^

Using VBScript


To program Microsoft Agent from VBScript, use the HTML

Although Microsoft Internet Explorer supports this latter syntax, not all browsers do. For compatibility, use only the former syntax for events.

With VBScript 2.0, you can verify whether Microsoft Agent is installed by trying to create the object and checking to see if it exists. The following sample demonstrates how to check for the Agent control without triggering an auto-download of the control (as would happen if you included an tag for the control on the page):


It will always fail to detect the Agent control

in VbScript 1.x, because CreateObject doesn't work.

-->


  1   2   3   4   5   6   7   8   9   10   11

Схожі:

ActiveX™ Technology for Interactive Software Agents iconActiveX™ Technology for Interactive Software Agents

ActiveX™ Technology for Interactive Software Agents iconActiveX™ Technology for Interactive Software Agents

ActiveX™ Technology for Interactive Software Agents iconActiveX™ Technology for Interactive Software Agents

ActiveX™ Technology for Interactive Software Agents iconActiveX™ Technology for Interactive Software Agents

ActiveX™ Technology for Interactive Software Agents iconActiveX™ Technology for Interactive Software Agents

ActiveX™ Technology for Interactive Software Agents iconActiveX™ Technology for Interactive Software Agents

ActiveX™ Technology for Interactive Software Agents iconActiveX™ Technology for Interactive Software Agents

ActiveX™ Technology for Interactive Software Agents iconActiveX™ Technology for Interactive Software Agents

ActiveX™ Technology for Interactive Software Agents iconActiveX™ Technology for Interactive Software Agents

ActiveX™ Technology for Interactive Software Agents iconActiveX™ Technology for Interactive Software Agents

Додайте кнопку на своєму сайті:
Документи


База даних захищена авторським правом ©zavantag.com 2000-2013
При копіюванні матеріалу обов'язкове зазначення активного посилання відкритою для індексації.
звернутися до адміністрації
Документи