views:

165

answers:

1

I'm trying to draw text using CDC::ExtTextOut() to a device context (CDC), but I'm getting garbage outputs. The output text was drawn is weird fonts.

The CDC pointer that got passed to me was originated from a unicode build ActiveX control (.ocx). The text drawing code resides in an ANSI build DLL.

It seems like there're some kind of incompatibilities in this setup.

Has anyone run into this situation and how did you solve it?

Thanks.

A: 

Have you tried setting a font on the CDC?

CFont *oldvalue = dc->SelectObject(GetStockObject(OEM_FIXED_FONT));

dc->ExtTextOut(....);

dc->SelectObject(oldvalue);
Steve