IVoiceCmd::MenuDelete

This method deletes a menu from the voice menu database.

Syntax

HRESULT MenuDelete( PVCMDNAME pName);

Parameters

pName
[in] Pointer to a VCMDNAME structure that identifies the menu to delete.

Return Values

NOERROR
The method successfully deleted the menu.
E_INVALIDARG
The argument is invalid.
VCMDERR_MENUACTIVE
The menu is currently active and cannot be deleted.
VCMDERR_MENUDOESNOTEXIST
The requested menu does not exist in the database.
VCMDERR_MENUOPEN
The menu exists but has not been released, so it cannot be deleted.
VCMDERR_OUTOFMEM
There is no more memory.

Remarks

A menu cannot be deleted if it is currently open and the application is actively listening for its commands.

This method deletes the storage in the database for the menu, if the menu exists, and releases the voice menu object that was created by the IVoiceCmd::MenuCreate method. After a menu is deleted, the pointer to its IVCmdMenu interface is invalid, so set it to NULL.