ReactOS  0.4.14-dev-49-gfb4591c
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 328 of file shellext.h.

Constructor & Destructor Documentation

◆ string_error()

string_error::string_error ( int  resno,

Definition at line 640 of file main.cpp.

640  {
641  wstring fmt, s;
642  int len;
643  va_list args;
645  if (!load_string(module, resno, fmt))
646  throw runtime_error("LoadString failed."); // FIXME
648  va_start(args, resno);
649  len = _vsnwprintf(nullptr, 0, fmt.c_str(), args);
651  if (len == 0)
652  s = L"";
653  else {
654  s.resize(len);
655  _vsnwprintf((wchar_t*)s.c_str(), len, fmt.c_str(), args);
656  }
658  va_end(args);
660  utf16_to_utf8(s, msg);
661 }
void utf16_to_utf8(const wstring &utf16, string &utf8)
Definition: main.cpp:694
string msg
Definition: shellext.h:337
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 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 332 of file shellext.h.

332  {
333  return msg.c_str();
334  }
string msg
Definition: shellext.h:337

Member Data Documentation

◆ msg

string string_error::msg

Definition at line 337 of file shellext.h.

Referenced by string_error(), and what().

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