IVDctNotifySink::CommandRecognize

HRESULT CommandRecognize(DWORD dwID, DWORD dwFlags,
DWORD dwActionSize, PVOID pAction, PTSTR pszCommand);

Sent when a spoken phrase was recognized as being from the application's command set. Along with the notification, the application receives the text of the phrase and the action data that was supplied by the application when it originally defined the command.

· Return value is ignored.

dwID

[in] Identifier of the command that was recognized. The command identifier is stored in the dwID member of the VCMDCOMMAND structure that defines the command.

dwFlags

[in] VCMDCMD_VERIFY if the application should request verification from the user or NULL if verification is not required. To request verification, the application should display a dialog box. An application would typically require verification for a destructive or irreversible command such as "Format disk."

dwActionSize

[in] Size of the data in pAction.

pAction

[in] Address of a string that contains action data to accompany the recognized command. The action data is obtained from the VCMDCOMMAND structure for the command.

pszCommand

[in] Address of the command string for the command that was recognized.

You should not use the contents of pszCommand to identify the recognized command. Instead, use the data in pAction or the identifier in dwID to determine which command was recognized. The pszCommand string may not contain the same string that you specified in the VCMDCOMMAND structure because it is possible for the user to edit the text for commands for your application using Microsoft Dictation or another voice-aware application.

The notification is sent to all applications that are registered on the voice-command site, regardless of the settings of the dwFlags parameter of the IVoiceDictation::Register member function when the application registered to use voice dictation.

If automatic locking is on then the buffer is locked as soon as this callback is made. The application will have to call IVDctText::UnLock.