IVCmdMenu::Get

This method retrieves information about one or more commands in a voice menu.

Syntax

HRESULT Get( DWORD dwCmdStart, DWORD dwCmdNum, DWORD dwFlag, PSDATA pdData, DWORD *pdwCmdNum);

Parameters

dwCmdStart
[in] Specifies the number of the first command to retrieve. Commands are numbered sequentially from 1 to n. If dwFlag is the VCMD_BY_IDENTIFIER value, this parameter is ignored.
dwCmdNum
[in] Specifies either the number of commands to retrieve or the identifier of the commands, depending on the value of dwFlag. If the sum of dwCmdStart and dwCmdNum exceeds the total number of commands in the menu, the method returns 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.
pdData
[out] Pointer to an SDATA structure that receives the address and size of a buffer. The buffer contains a list of VCMDCOMMAND structures that describe the commands retrieved. Although they vary in size depending on the command data, the structures are contiguous within the list.
pdwCmdNum
[out] Pointer to a DWORD that receives the number of commands actually copied to the buffer.

Return Values

NOERROR
The method successfully retrieved information about the commands.
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

The calling application allocates the SDATA structure and passes its address to Get. Using the OLE task allocator, Get allocates memory for the returned data and sets the pData member of SDATA to point to the memory. If the allocation fails, pData is set to NULL and the dwSize member is set to zero. The calling application must free the memory pointed to by pData, as well as the SDATA structure itself, by calling the CoTaskMemFree function.