ISpPhraseBuilder::InitFromPhrase

This method initializes the phrase being built from the specified phrase.

HRESULT InitFromPhrase(
  const SPPHRASE* pSrcPhrase
);

Parameters

  • pSrcPhrase
    [in] Pointer to an SPPHRASE structure containing a phrase from which to initialize. If this parameter is NULL, the phrase builder resets the phrase being built to its initial state.

Return Values

The following table shows the possible return values.

Value Description
S_OK Function completed successfully.
E_INVALIDARG Provided SPPHRASE structure or the member Rule.pNextSibling is invalid or bad. Alternatively, SPPHRASE.LangID can be zero, or SPPHRASE.cbSize is not correct for the phrase being built.
FAILED(hr) Appropriate error message.

Example

The following code snippet demonstrates creating and initializing from a phrase.

HRESULT hr;

CComPtr<ISpPhraseBuilder> cpPhraseBuilder;
CComPtr<ISpPhrase>        cpPhrase;
SPPHRASE    Phrase;

hr = cpPhraseBuilder.CoCreateInstance( CLSID_SpPhraseBuilder );

if (SUCCEEDED(hr))
{
    //Initialize the Phrase data structure 
}

if (SUCCEEDED(hr))
{
    hr = cpPhraseBuilder->InitFromPhrase( &Phrase );
}

Requirements

OS Versions: Windows CE .NET 4.1 and later.
Header: Sapi.h, Sapi.idl.
Link Library: Sapilib.lib.

See Also

ISpPhraseBuilder | SAPI Interfaces

 Last updated on Saturday, April 10, 2004

© 1992-2003 Microsoft Corporation. All rights reserved.