ReactOS  0.4.14-dev-317-g96040ec
last_error Class Reference

#include <shellext.h>

Inheritance diagram for last_error:
Collaboration diagram for last_error:

Public Member Functions

 last_error (DWORD errnum)
 
const charwhat () const noexcept
 

Private Attributes

string msg
 

Additional Inherited Members

- Public Attributes inherited from __exception
vtable_ptrvtable
 
charname
 
int do_free
 
const vtable_ptrvtable
 
BOOL do_free
 

Detailed Description

Definition at line 365 of file shellext.h.

Constructor & Destructor Documentation

◆ last_error()

last_error::last_error ( DWORD  errnum)

Definition at line 768 of file main.cpp.

768  {
769  WCHAR* buf;
770 
772  errnum, 0, (WCHAR*)&buf, 0, nullptr) == 0)
773  throw runtime_error("FormatMessage failed");
774 
775  try {
776  msg = utf16_to_utf8(buf);
777  } catch (...) {
778  LocalFree(buf);
779  throw;
780  }
781 
782  LocalFree(buf);
783 }
GLenum GLuint GLenum GLsizei const GLchar * buf
Definition: glext.h:7751
DWORD WINAPI FormatMessageW(DWORD dwFlags, LPCVOID lpSource, DWORD dwMessageId, DWORD dwLanguageId, LPWSTR lpBuffer, DWORD nSize, __ms_va_list *args)
Definition: format_msg.c:583
#define FORMAT_MESSAGE_ALLOCATE_BUFFER
Definition: winbase.h:400
static string utf16_to_utf8(const wstring_view &utf16)
Definition: main.cpp:672
#define FORMAT_MESSAGE_FROM_SYSTEM
Definition: winbase.h:404
__wchar_t WCHAR
Definition: xmlstorage.h:180
string msg
Definition: shellext.h:374
#define FORMAT_MESSAGE_IGNORE_INSERTS
Definition: winbase.h:401
HLOCAL NTAPI LocalFree(HLOCAL hMem)
Definition: heapmem.c:1577

Member Function Documentation

◆ what()

const char* last_error::what ( ) const
inlinenoexcept

Definition at line 369 of file shellext.h.

369  {
370  return msg.c_str();
371  }
string msg
Definition: shellext.h:374

Member Data Documentation

◆ msg

string last_error::msg
private

Definition at line 374 of file shellext.h.

Referenced by last_error().


The documentation for this class was generated from the following files: