Yet Another MFC Bug
This is cute. In Visual Studio 2005, if you use CString::FormatMessage() in a way that generates an empty string, it throws a CMemoryException indicating that you're out of memory. Hilarity ensues.
What you should get is a nice harmless null-terminated empty string.
And maybe you do in Visual Studio 2008. But I'm not holding my breath.