IVCmdMenu::Get

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

Retrieves information about one or more commands in a voice menu.

· Returns NOERROR if successful, or one of these error values:

E_INVALIDARG
VCMDERR_INVALIDCHAR
VCMDERR_MENUTOOCOMPLEX
VCMDERR_OUTOFDISK
VCMDERR_OUTOFMEM
VCMDERR_VALUEOUTOFRANGE

dwCmdStart

[in] 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] 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 function returns as many commands as possible.

dwFlag

[in] Flag that identifies the nature of dwCmdNum. This parameter can be one of these values:

VCMD_BY_IDENTIFIER
VCMD_BY_POSITION

pdData

[out] Address of 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] Address of a variable that receives the number of commands actually copied to the buffer.

The calling application allocates the SDATA structure and passes its address to Get. Get allocates memory (using the OLE task allocator) 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.

The calling application must free the memory allocated by the member function by using the CoTaskMemFree function.