MCPcopy Create free account
hub / github.com/davisking/dlib / error_box

Function error_box

dlib/gui_core/gui_core_kernel_1.cpp:347–381  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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

Callers 1

CALLBACKFunction · 0.85

Calls 2

create_new_threadFunction · 0.50

Tested by

no test coverage detected