ReactOS 0.4.16-dev-401-g45b008d
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 766 of file main.cpp.

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

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 }

Member Data Documentation

◆ msg

string last_error::msg
private

Definition at line 374 of file shellext.h.

Referenced by last_error(), and what().


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