From f61e83d936ebab185b09682f922aa58734153761 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?John=20Ankarstr=C3=B6m?= Date: Fri, 15 Jul 2022 16:40:49 +0200 Subject: Add Win32Error exception class. --- c/defs.h | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) (limited to 'c/defs.h') diff --git a/c/defs.h b/c/defs.h index 5a6a25a..102dce2 100644 --- a/c/defs.h +++ b/c/defs.h @@ -3,16 +3,26 @@ #include #include +#include #include #include #include /* 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(); -- cgit v1.2.3