Код: Выделить всё
DWORD WINAPI FormatMessage(
_In_ DWORD dwFlags,
_In_opt_ LPCVOID lpSource,
_In_ DWORD dwMessageId,
_In_ DWORD dwLanguageId,
_Out_ LPTSTR lpBuffer,
_In_ DWORD nSize,
_In_opt_ va_list *Arguments
);
Код: Выделить всё
std::string bmd2File::getErrorCodeDescription(long errorCode) const throw (bmd2Exception)
{
#ifdef _WIN32
char MessageFromSystem[1024];
bool messageReceived = FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM,
0,
errorCode,
1033, // US English
MessageFromSystem,
1024,
0);
std::ostringstream ostr;
if (!messageReceived)
ostr
Подробнее здесь: [url]https://stackoverflow.com/questions/20726471/windows-api-fetching-results-of-formatmessage-into-a-stdstring[/url]
Мобильная версия