I have the following code fragment:
hDC = CreateCompatibleDC(NULL);
hBitmap = CreateCompatibleBitmap(hDC);
SelectPalette(hDC, myPalette, FALSE);
SetTextColor(hDC, PALETTEINDEX(1)); /* Usually yellow, but all colors fail */
ret = ExtTextOut(hDC, x, y, 0, NULL, chars, nchars, spacing); /* all valid */
if (ret == 0)
error = GetLastError();
At this point ret is 0 and error is 0. Why? Here is some more information:
This fails on Windows NT 4.0 with lastest patch. It works on Windows 95.
TextOut works. Only ExtTextOut fails.
It works if hDC is a window DC.
In summary, the ExtTextOut to a Bitmap fails on Windows NT 4.0. GetLastError returns 0.
Is this a known bug? Is there a workaround?