MCPcopy Create free account
hub / github.com/TheRealMJP/DeferredTexturing / Exception

Class Exception

SampleFramework12/v1.00/Exceptions.h:131–166  ·  view source on GitHub ↗

Generic exception, used as base class for other types

Source from the content-addressed store, hash-verified

129
130// Generic exception, used as base class for other types
131class Exception
132{
133
134public:
135
136 Exception()
137 {
138 }
139
140 // Specify an actual error message
141 Exception(const std::wstring& exceptionMessage) : message(exceptionMessage)
142 {
143 }
144
145 Exception(const std::string& exceptionMessage)
146 {
147 wchar buffer[512];
148 MultiByteToWideChar(CP_ACP, 0, exceptionMessage.c_str(), -1, buffer, 512);
149 message = std::wstring(buffer);
150 }
151
152 // Retrieve that error message
153 const std::wstring& GetMessage() const throw()
154 {
155 return message;
156 }
157
158 void ShowErrorMessage() const throw ()
159 {
160 MessageBox(NULL, message.c_str(), L"Error", MB_OK|MB_ICONERROR);
161 }
162
163protected:
164
165 std::wstring message; // The error message
166};
167
168// Exception thrown when a Win32 function fails.
169class Win32Exception : public Exception

Callers 10

ParseFunction · 0.85
ToStringFunction · 0.85
ToAnsiStringFunction · 0.85
GetExpandedShaderCodeFunction · 0.85
CompileShaderFunction · 0.85
InitializeFunction · 0.85
LoadTextureFunction · 0.85
SaveTextureAsEXRFunction · 0.85
CreateWithAssimpMethod · 0.85
CreateFromMeshDataMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected