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

Class Win32Exception

SampleFramework12/v1.00/Exceptions.h:169–202  ·  view source on GitHub ↗

Exception thrown when a Win32 function fails.

Source from the content-addressed store, hash-verified

167
168// Exception thrown when a Win32 function fails.
169class Win32Exception : public Exception
170{
171
172public:
173
174 // Obtains a string for the specified Win32 error code
175 Win32Exception(DWORD code, const wchar* msgPrefix = nullptr) : errorCode(code)
176 {
177 wchar errorString[MAX_PATH];
178 ::FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM,
179 0,
180 errorCode,
181 MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT),
182 errorString,
183 MAX_PATH,
184 NULL );
185
186 message = L"Win32 Error: ";
187 if(msgPrefix)
188 message += msgPrefix;
189 message += errorString;
190 }
191
192 // Retrieve the error code
193 DWORD GetErrorCode() const throw ()
194 {
195 return errorCode;
196 }
197
198protected:
199
200 DWORD errorCode; // The Win32 error code
201
202};
203
204// Exception thrown when a DirectX Function fails
205class DXException : public Exception

Callers 13

GetMouseStateMethod · 0.85
SetCursorPosMethod · 0.85
OpenMethod · 0.85
WindowMethod · 0.85
SetWindowStyleMethod · 0.85
SetExtendedStyleMethod · 0.85
MakeWindowMethod · 0.85
SetWindowPosMethod · 0.85
GetWindowPosMethod · 0.85
SetClientAreaMethod · 0.85
GetClientAreaMethod · 0.85
SetWindowTitleMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected