Skip to content

Instantly share code, notes, and snippets.

@daxliar
daxliar / GetLastErrorStdStr.cpp
Last active May 16, 2018 18:12
Create a string with last error message
// Needs Windows constant and type definitions
#include <windows.h>
#include <string>
// Create a string with last error message
std::string GetLastErrorStdStr()
{
DWORD error = GetLastError();
if (error)