Exception thrown when a GDI+ function fails
| 232 | |
| 233 | // Exception thrown when a GDI+ function fails |
| 234 | class GdiPlusException : public Exception |
| 235 | { |
| 236 | |
| 237 | public: |
| 238 | |
| 239 | // Obtains a string for the specified error code |
| 240 | GdiPlusException(Gdiplus::Status status) : errorCode(status) |
| 241 | { |
| 242 | message = GetGdiPlusErrorString(status); |
| 243 | } |
| 244 | |
| 245 | // Retrieve the error code |
| 246 | Gdiplus::Status GetErrorCode() const throw () |
| 247 | { |
| 248 | return errorCode; |
| 249 | } |
| 250 | |
| 251 | protected: |
| 252 | |
| 253 | Gdiplus::Status errorCode; // The GDI+ error code |
| 254 | }; |
| 255 | |
| 256 | // Error-handling functions |
| 257 |