ReactOS  0.4.15-dev-994-ga9f6032
string_error Class Reference

#include <shellext.h>

Inheritance diagram for string_error:
Collaboration diagram for string_error:

Public Member Functions

 string_error (int resno,...)
const charwhat () const noexcept

Private Attributes

string msg

Additional Inherited Members

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

Detailed Description

Definition at line 352 of file shellext.h.

Constructor & Destructor Documentation

◆ string_error()

string_error::string_error ( int  resno,

Definition at line 709 of file main.cpp.

709  {
710  wstring fmt, s;
711  int len;
712  va_list args;
714  if (!load_string(module, resno, fmt))
715  throw runtime_error("LoadString failed."); // FIXME
717  va_start(args, resno);
718  len = _vsnwprintf(nullptr, 0, fmt.c_str(), args);
720  if (len == 0)
721  s = L"";
722  else {
723  s.resize(len);
724  _vsnwprintf((wchar_t*)s.c_str(), len, fmt.c_str(), args);
725  }
727  va_end(args);
729  msg = utf16_to_utf8(s);
730 }
string msg
Definition: shellext.h:361
const char * fmt
Definition: wsprintf.c:30
Definition: match.c:390
#define va_end(ap)
Definition: acmsvcex.h:90
char * va_list
Definition: acmsvcex.h:78
static string utf16_to_utf8(const wstring_view &utf16)
Definition: main.cpp:672
static const WCHAR L[]
Definition: oid.c:1250
GLenum GLsizei len
Definition: glext.h:6722
GLdouble s
Definition: gl.h:2039
bool load_string(HMODULE module, UINT id, wstring &s)
Definition: main.cpp:206
_CRTIMP int __cdecl _vsnwprintf(wchar_t *_Dest, size_t _Count, const wchar_t *_Format, va_list _Args)
#define va_start(ap, A)
Definition: acmsvcex.h:91
#define args
Definition: format.c:66
Definition: dsound.c:943

Member Function Documentation

◆ what()

const char* string_error::what ( ) const

Definition at line 356 of file shellext.h.

356  {
357  return msg.c_str();
358  }
string msg
Definition: shellext.h:361

Member Data Documentation

◆ msg

string string_error::msg

Definition at line 361 of file shellext.h.

Referenced by string_error().

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