TextOutPut

Hi. Im simply trying to use TextOut() to Display two strings.
One constant, and one which may vary.
I use a TEXTMETRIC field to keep track on where to begin the secound TextOut(). The problem is that the cxChar(which should contain the character width, have a far too low value. And YES, I am using SYSTEM_FIXED_FONT

The size of the text is dependent on the HDC. A given string may not be the same size on diff Device Contexts, even if the DC's have the same font.

MSDN
"If an application needs to update the current position when it calls TextOut, the application can call the SetTextAlign member function with nFlags set to TA_UPDATECP. When this flag is set, Windows ignores the x and y parameters on subsequent calls to TextOut, using the current position instead."

This means that it will remember where you drew the last text (so you would have to keep resetting it).

"...the results are undefined, and we all know what "undefined" means: it means it works during development, it works during testing, and it blows up in your most important customers' faces." --Scott Meyers

If you are going to be using C++ I suggest you start using C++ style casts. Basically C-style casts are reinterpret_cast< >( ) and can be very dangerous if you don't know what you are doing or aren't careful. There are many other reasons too that I'll leave up to you to find.

"...the results are undefined, and we all know what "undefined" means: it means it works during development, it works during testing, and it blows up in your most important customers' faces." --Scott Meyers