Invoking WMI Object Methods

Published: June 20, 2005

Invoking WMI Object Methods

This topic describes how to use object methods to perform actions on Microsoft Speech Server (MSS) objects.

Understanding WMI Object Methods in MSS

Use a class's methods to perform actions on the Windows Management Instrumentation (WMI)-managed resource. The SES, TAS, and TrustedSite classes include methods, documented in the Server Methods Reference.

Using Scripts to Stop or Start a Service

Additional service-related methods are provided in the WMI component of the Microsoft Windows operating system, and documented in the Windows platform SDK. For more information, see the topic WMI Win32_Service class.

Script examples that use the Win32 WMI provider to start and stop Speech Engine Services (SES) and Telephony Application Services (TAS) can be found in the topic Scripting Win32 Provider Methods.

Monitoring Asynchronous Methods

Methods can be synchronous or asynchronous. Synchronous methods take control of a thread while the method executes. Most methods are synchronous. Synchronous methods are easier to write and use, but if they do not finish immediately they may block an application. Asynchronous methods return control to the thread that called them, while they execute on another thread. The advantage to using asynchronous methods is that program flow can continue while a time-consuming operation is underway on another thread. The disadvantage is that there needs be a way to determine when the method has finished.

All MSS object methods are asynchronous. To determine whether an asynchronous method is finished, use event notifications, or look at the server state in MMC to see whether a method like StartService or StopService has finished. For more information about event notifications, see Monitoring Service Status Changes.