diff options
author | John Ankarström <john@ankarstrom.se> | 2022-07-15 16:40:49 +0200 |
---|---|---|
committer | John Ankarström <john@ankarstrom.se> | 2022-07-15 16:40:49 +0200 |
commit | f61e83d936ebab185b09682f922aa58734153761 (patch) | |
tree | 6881c8582a37b32f0ad2763c1e23c73cf6a33404 /c/defs.h | |
parent | dcb9fabf265068a42231589ba8f83bd09eb46d38 (diff) | |
download | EpisodeBrowser-f61e83d936ebab185b09682f922aa58734153761.tar.gz |
Add Win32Error exception class.
Diffstat (limited to 'c/defs.h')
-rw-r--r-- | c/defs.h | 14 |
1 files changed, 12 insertions, 2 deletions
@@ -3,16 +3,26 @@ #include <memory> #include <optional> +#include <stdexcept> #include <windows.h> #include <commctrl.h> #include <SWI-Prolog.h> /* common.cpp */ TCHAR *TszFromSz(const char *, int); +struct Win32Error : public std::exception +{ + Win32Error(DWORD); + ~Win32Error(void); + virtual const char *what(void) const noexcept override; +private: + DWORD m_dwErr; + char *m_szMsg = NULL; +}; struct Library { Library(const TCHAR *); - ~Library(); + ~Library(void); FARPROC GetProcAddress(const char *); private: HMODULE m_hModule; @@ -70,7 +80,7 @@ int Plx(const char *, const char *); struct Query { Query(module_t ctx, predicate_t p, term_t t0); - ~Query(); + ~Query(void); int Cut(); int Close(); int NextSolution(); |