I am working on a sample in this I am creating a EMF file with some text in it. To add a text I am using the API ExtTextOutW() with ETO_IGNORELANGUAGE option.
Return value of this API is TRUE. But when I open the EMF file the text is not present. Then I saw the records. There is no entey for the ExtTextOutW.
Bellw is the code.
HDC hDC = GetDC(hWnd);
RECT Rect = {0, 0, 21590, 27940};
//Create the EMF file DC
HDC hEMFDC = ::CreateEnhMetaFile(hDC, L"c:\\del\\1.emf", &Rect, L"Test");
if (NULL != hEMFDC)
{
RECT Rect = {0, 0, 300, 155};
HBRUSH hb = CreateSolidBrush(0X00FFFF00);
FillRect(hEMFDC, &Rect, hb);
DeleteObject(hb);
int dx[12] = {25,25,25,25,25,25, 25,25,25,25,25,25};
WCHAR wcsBuffer[] = L"Text Message";
ExtTextOutW(hEMFDC, 10, 10, ETO_IGNORELANGUAGE, NULL, wcsBuffer, wcslen(wcsBuffer), dx);
HENHMETAFILE hmf = CloseEnhMetaFile(hEMFDC);
DeleteEnhMetaFile(hmf);
hEMFDC = NULL;
}
ReleaseDC(hWnd, hDC);
Please let me know any thing I am doing wrong in the above code.
Did you read the documentation for
ExtTextOut[W]
(MSDN), especially the part for the flags like ETO_IGNORELANGUAGE:Just try it without this flag.