How can I get an accurate text extent. I have tried using CDC::GetTextExtent but often the horizontal extent returned is not accurate. I need an accurate value because I am drawing a string in a box and I dont want the string to overrun the box if it wont fit in the box. Using the GetTextExtent function it returns a value that says the string will fit in the box when it in actuality it wont. Anyone have any ideas on how I can get the accurate horizontal extent of the string. Any help is greatly appreciated.