ISpDisplayAlternates::GetDisplayAlternates (Microsoft Speech Platform)
Microsoft Speech Platform
ISpDisplayAlternates::GetDisplayAlternates
ISpDisplayAlternates::GetDisplayAlternates gets the specified number of display forms for a specified phrase.
HRESULT GetDisplayAlternates(
const SPDISPLAYPHRASE *pPhrase,
ULONG cRequestCount,
SPDISPLAYPHRASE **ppCoMemPhrases,
ULONG *pcPhrasesReturned
);
Parameters
- pPhrase
Specifies the address of an SPDISPLAYPHRASE structure that contains the phrase. Must not be null. - cRequestCount
Specifies the number of dislay forms to get. - ppCoMemPhrases
Specifies a pointer to an array of pointers to SPDISPLAYPHRASE structures. Each SPDISPLAYPHRASE will contain one display form. Must not be null. - pcPhrasesReturned
Specifies the address of memory that contains the number of display forms. Must not be null.
Return values
Value |
S_OK |
E_INVALIDARG |
E_OUTOFMEMORY |
E_FAIL |
FAILED(hr) |
Remarks
The caller is responsible for allocating memory (using CoTaskMemAlloc) for a block of memory large enough to contain an array of cRequestCount pointers to SPDISPLAYPHRASE structures, with ppCoMemPhrases set with the address of this memory block. GetDisplayAlternates internally allocates storage for cRequestCount structures and then modifies the addresses in ppCoMemPhrases to point to the storage locations. After the function returns, the caller must free the storage for each SPDISPLAYPHRASE structure, using CoTaskMemFree. Finally, the caller must free the memory that was allocated for the array of structure pointers.