I'm trying to create a GL context, and the call fails, returning a null pointer. According to MSDN, when wglCreateContext fails, you get the reason why from GetLastError. Except that GetLastError gives me a number, which isn't all that informative.
Again according to MSDN, you can get a descriptive string out of the GetLastError code with FormatMessage. But when I try the following, I get a blank string:
FormatMessageA(FORMAT_MESSAGE_FROM_SYSTEM, 0, GetLastError(), 0, errorStr, 0, NULL);
I checked the MSDN documentation, and apparently it only has a lookup table for Windows system errors. So that's no help to me afterall. Does anyone know how to figure out programmatically why my wglCreateContext call is failing?