Yah, I guess I should point out I ran that code in a WM_PAINT
handler for a dialog to make sure it worked. (TDM's code actually
had some small errors)

Also the following includes are needed in the header for the
templates and string
#include <string>
#include <sstream>
#include <iostream>
#include <iomanip>

I kinda had the feeling CString would be used so I was a bit sloppy

(I guess I just wanted to show how to do it right (with the standard) and definitely not with new char[].)