1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27
|
bool GdipErrorHandler(int code) {
switch (code) {
case Gdiplus::Ok: return 1;
case Gdiplus::GenericError: MessageBoxW(0, L"Generic Error", L"Error", MB_ICONWARNING); return 0;
case Gdiplus::InvalidParameter: MessageBoxW(0, L"Invalid Parameter", L"Error", MB_ICONWARNING); return 0;
case Gdiplus::OutOfMemory: MessageBoxW(0, L"Out Of Memory", L"Error", MB_ICONWARNING); return 0;
case Gdiplus::ObjectBusy: MessageBoxW(0, L"Object Busy", L"Error", MB_ICONWARNING); return 0;
case Gdiplus::InsufficientBuffer: MessageBoxW(0, L"Insufficient Buffer", L"Error", MB_ICONWARNING); return 0;
case Gdiplus::NotImplemented: MessageBoxW(0, L"Not Implemented", L"Error", MB_ICONWARNING); return 0;
case Gdiplus::Win32Error: MessageBoxW(0, L"Win32 Error", L"Error", MB_ICONWARNING); return 0;
case Gdiplus::Aborted: MessageBoxW(0, L"Aborted", L"Error", MB_ICONWARNING); return 0;
case Gdiplus::FileNotFound: MessageBoxW(0, L"File Not Found", L"Error", MB_ICONWARNING); return 0;
case Gdiplus::ValueOverflow: MessageBoxW(0, L"Value Overflow", L"Error", MB_ICONWARNING); return 0;
case Gdiplus::AccessDenied: MessageBoxW(0, L"Access Denied", L"Error", MB_ICONWARNING); return 0;
case Gdiplus::UnknownImageFormat: MessageBoxW(0, L"Unknown Image Format", L"Error", MB_ICONWARNING); return 0;
case Gdiplus::FontFamilyNotFound: MessageBoxW(0, L"Font Family Not Found", L"Error", MB_ICONWARNING); return 0;
case Gdiplus::FontStyleNotFound: MessageBoxW(0, L"Font Style Not Found", L"Error", MB_ICONWARNING); return 0;
case Gdiplus::NotTrueTypeFont: MessageBoxW(0, L"Not TruType Font", L"Error", MB_ICONWARNING); return 0;
case Gdiplus::UnsupportedGdiplusVersion: MessageBoxW(0, L"Unsupported Gdiplus Version", L"Error", MB_ICONWARNING); return 0;
case Gdiplus::GdiplusNotInitialized: MessageBoxW(0, L"Gdiplus Not Initialized", L"Error", MB_ICONWARNING); return 0;
case Gdiplus::PropertyNotFound: MessageBoxW(0, L"Property Not Found", L"Error", MB_ICONWARNING); return 0;
case Gdiplus::PropertyNotSupported: MessageBoxW(0, L"Property Not Supported", L"Error", MB_ICONWARNING); return 0;
default: MessageBoxW(0, L"Unknown Error", L"Error", MB_ICONWARNING); return 0;
}
return 0;
}
| |