반응형

http://kaludin.egloos.com/2547365




[C/VC++] 에러코드 문자열로 변환 : FormatMessage 『C/C++』


  LPVOID lpMsgBuf; 
  FormatMessage( FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS,
     NULL, GetLastError(), MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), // Default language
     (LPTSTR) &lpMsgBuf, 0, NULL ); // Process any inserts in lpMsgBuf. // ... 
     // Display the string. 
  MessageBox( NULL, (LPCTSTR)lpMsgBuf, "Error", MB_OK | MB_ICONINFORMATION ); // Free the buffer. 
  LocalFree( lpMsgBuf ); 


Windows 98 은 잘안된다고 함. 참고해주세열.

반응형

+ Recent posts