#include #include "Win32Internal.h" const char* Win32GetMessage(DWORD messageId) { static char buf[1024] = { '\0' }; DWORD rc = FormatMessage( FORMAT_MESSAGE_IGNORE_INSERTS | FORMAT_MESSAGE_FROM_SYSTEM, NULL, messageId, MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), buf, 1024, NULL); if (!rc) { strcpy_s(buf, "Unkown error!\n"); } return buf; }