Hi FayWang, thanks for th reply. I tried out the API but the API DWriteCreateFactory() fails for the IDWriteTextAnalysisSink interface. The HRESULT error is "Not an interface". Below is the code I have used. Could you please check and point out where I have possibly gone wrong?
IDWriteNumberSubstitution* sub;
IDWriteFactory* fact;
HRESULT hr = DWriteCreateFactory(DWRITE_FACTORY_TYPE_SHARED, __uuidof(IDWriteFactory), reinterpret_cast<IUnknown**>(&fact));
if (SUCCEEDED(hr))
{
hr = fact->CreateNumberSubstitution(DWRITE_NUMBER_SUBSTITUTION_METHOD_CONTEXTUAL, strLocale.c_str(), TRUE, &sub); // strLocale contains say "en-us" for eg:
if (SUCCEEDED(hr))
{
IDWriteTextAnalysisSink* sink;
hr = DWriteCreateFactory(DWRITE_FACTORY_TYPE_SHARED,__uuidof(IDWriteTextAnalysisSink), reinterpret_cast<IUnknown**>(&sink)); // Fails
if (SUCCEEDED(hr))
{
hr = sink->SetNumberSubstitution(0, m_myStringVal.GetLength(), sub); // m_myStringVal is CString
if (SUCCEEDED(hr))
{
}
}
}
}