TextAnalysis interface

  • Thread starter Thread starter its_me_here
  • Start date Start date
I

its_me_here

Guest
I am trying to invoke the SetNumberSubstitution() API of IDWriteTextAnalysisSink interface for a particular locale. Below is the code


HRESULT hr = DWriteCreateFactory(DWRITE_FACTORY_TYPE_SHARED, __uuidof(IDWriteFactory), reinterpret_cast<IUnknown**>(&fact));
if (SUCCEEDED(hr))
{
// strLocale conatins the locale
hr = fact->CreateNumberSubstitution(DWRITE_NUMBER_SUBSTITUTION_METHOD_CONTEXTUAL, strLocale.c_str(), TRUE, &sub);
if (SUCCEEDED(hr))
{
IDWriteTextAnalysisSink* sink;
// Fails here
hr = fact->QueryInterface(__uuidof(IDWriteTextAnalysisSink), reinterpret_cast<PVOID*>(&sink));
if (SUCCEEDED(hr))
{
CString m_strValue; //Contains the value on which to set the substituion
hr = sink->SetNumberSubstitution(0, m_strValue.GetLength(), sub);
if (SUCCEEDED(hr))
{

}
}
}

But the QueryInterface() call to get IDWriteTextAnalysisSink fails with error E_NOINTERFACE. Could someone please what could be wrong here?

Continue reading...
 
Back
Top