| 345 | } |
| 346 | |
| 347 | static void error_box ( |
| 348 | const char* title, |
| 349 | const char* text, |
| 350 | bool nonblocking = false |
| 351 | ) |
| 352 | { |
| 353 | try |
| 354 | { |
| 355 | if (nonblocking) |
| 356 | { |
| 357 | ebh_param* param = new ebh_param; |
| 358 | param->text = text; |
| 359 | param->title = title; |
| 360 | dlib::create_new_thread(error_box_helper,param); |
| 361 | } |
| 362 | else |
| 363 | { |
| 364 | #ifdef UNICODE |
| 365 | MessageBox (NULL, convert_mbstring_to_wstring(text).c_str(), |
| 366 | convert_mbstring_to_wstring(title).c_str(), |
| 367 | MB_OK|MB_ICONERROR|MB_SYSTEMMODAL |
| 368 | ); |
| 369 | #else |
| 370 | MessageBox (NULL, text, |
| 371 | title, MB_OK|MB_ICONERROR|MB_SYSTEMMODAL |
| 372 | ); |
| 373 | #endif |
| 374 | } |
| 375 | } |
| 376 | catch (...) |
| 377 | { |
| 378 | // we are totally screwed if this happens so just quit |
| 379 | exit(0); |
| 380 | } |
| 381 | } |
| 382 | |
| 383 | // ---------------------------------------------------------------------------------------- |
| 384 |
no test coverage detected