카테고리 없음
GetLastError() 에러코드를 문자열로 표시하기
좋은나무
2015. 5. 21. 10:47
LPVOID lpMsgBuf;
DWORD dwError = GetLastError();
FormatMessage(
FORMAT_MESSAGE_ALLOCATE_BUFFER |
FORMAT_MESSAGE_FROM_SYSTEM |
FORMAT_MESSAGE_IGNORE_INSERTS,
NULL,
dwError,
MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT),
(LPTSTR) &lpMsgBuf,
0, NULL );
::OutputDebugString((LPCTSTR)lpMsgBuf);
LocalFree(lpMsgBuf);
[참고 : Retrieving the Last-Error Code]