// WinException.h // // Exception class for the RFC framework. // // Revision Log // // Date Who SAR Notes // ========== === ======= ===================================== // (c) Reliable Software, 1997, 98 // Bartosz Milewski, www.relisoft.com // 2001-10-26 mph Add path and line number #ifndef WINEXCEPTION_H #define WINEXCEPTION_H #include #include // out of memory handler that throws WinException int NewHandler(size_t size); class WinException { public: WinException(char* msg, const char* path="", int line=0) :_err(GetLastError()), _msg(msg), _path(path), _line(line) {;} DWORD GetError() const { return _err; } char const * GetMessage() const { return _msg; } const char* GetPath() { return _path.c_str(); } int GetLine() { return _line; } private: DWORD _err; char * _msg; std::string _path; int _line; }; #endif // WINEXCEPTION_H