IVCmdMenu::Set
This method sets information for one or more commands in a voice menu.
Syntax
HRESULT Set( DWORD dwCmdStart, DWORD dwCmdNum, DWORD dwFlag, SDATA dData);
Parameters
- dwCmdStart
- [in] Specifies the number of the first command to set in the voice menu. Command positions are sequential, starting with 1 for the first command on the menu. If dwFlag is the VCMD_BY_IDENTIFIER value, dwCmdStart is ignored.
- dwCmdNum
- [in] Specifies either the number of commands to set or the identifier of the commands, depending on the value of dwFlag. If the sum of dwCmdStart and dwCmdNum exceeds the number of commands in the menu, the method sets as many commands as possible.
- dwFlag
- [in] Specifies the nature of dwCmdNum. It is one of the following flags:
- VCMD_BY_IDENTIFIER
- The dwCmdNum parameter is the identifier of the command.
- VCMD_BY_POSITION
- The dwCmdNum parameter is the position in the list of commands.
- dData
- [in] SDATA structure that contains a pointer to a data buffer and the size of the buffer. The data buffer contains a list of VCMDCOMMAND structures that describe the voice commands to set. Although they vary in size depending on the command data, the structures are contiguous within the list.
Return Values
- NOERROR
- The method successfully set information for one or more commands in the voice menu.
- E_INVALIDARG
- The argument is invalid.
- VCMDERR_INVALIDCHAR
- There is an invalid character in the voice menu.
- VCMDERR_MENUTOOCOMPLEX
- The menu is too complex to use.
- VCMDERR_OUTOFDISK
- No disk space is left to write information.
- VCMDERR_OUTOFMEM
- There is no more memory.
- VCMDERR_VALUEOUTOFRANGE
- The value is out of range.
Remarks
For best results, deactivate the voice menu before calling Set. Calling Set on an active menu can be fairly slow because the menu must be deactivated, recompiled, and reactivated before Set returns. If the menu is already deactivated when Set is called, the menu is not recompiled until the application activates it again.