IVCmdMenu::ListGet

This method retrieves the phrases stored in the current list for the selected voice menu.

Syntax

HRESULT ListGet( PTSTR pszList, PSDATA pdList, DWORD *pdwListNum);

Parameters

pszList
[in] Pointer to the null-terminated string that contains the name of the list, such as “name” or “weekday.” The list name must appear in the command string for at least one command on the menu. The command string is stored in the dwCommand member of the VCMDCOMMAND structure that defines the command.
pdList
[out] Pointer to an SDATA structure that receives the address and size of a buffer. The buffer contains a sequential list of null-terminated strings, one for each phrase in the list.
pdwListNum
[out] Pointer to a DWORD that receives the number of phrases that were copied to the buffer. If the list is empty, this parameter receives zero.

Return Values

NOERROR
The method successfully retrieved the phrases stored in the current list.
E_INVALIDARG
The argument is invalid.
VCMDERR_INVALIDLIST
An invalid list was passed.
VCMDERR_OUTOFMEM
There is no more memory.

Remarks

A list is associated with a menu rather than an individual command. The list must appear in at least one command string, but can be used by more than one command on the menu.

The calling application allocates the SDATA structure and passes its address to ListGet. Using the OLE task allocator, ListGet allocates memory for the returned data and sets the pData member of the SDATA structure to point to the memory. If the allocation fails, the pData member 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.