11#include " ../../include/NavKit/util/ErrorHandler.h"
2- #include " ../../include/NavKit/module/Renderer.h"
32#include " ../../include/NavKit/Resource.h"
3+ #include " ../../include/NavKit/module/Renderer.h"
44
55std::string *ErrorHandler::errorMessage = nullptr ;
66
@@ -18,27 +18,26 @@ INT_PTR CALLBACK ErrorHandler::ErrorDialogHandler(HWND hwndDlg, UINT uMsg, WPARA
1818 EndDialog (hwndDlg, IDOK);
1919 return TRUE ;
2020 }
21- if (LOWORD (wParam) == IDC_COPY_BUTTON) {
22- OpenClipboard (hwndDlg);
23- EmptyClipboard ();
24- if (errorMessage) {
25- HGLOBAL hMem = GlobalAlloc (GMEM_MOVEABLE, errorMessage->length () + 1 );
26- char *data = (char *) GlobalLock (hMem);
27- strcpy_s (data, errorMessage->length () + 1 , errorMessage->c_str ());
28- GlobalUnlock (hMem);
29- SetClipboardData (CF_TEXT, hMem);
30- CloseClipboard ();
31- GlobalFree (hMem);
21+ if (LOWORD (wParam) == IDC_COPY_BUTTON) {
22+ OpenClipboard (hwndDlg);
23+ EmptyClipboard ();
24+ if (errorMessage) {
25+ HGLOBAL hMem = GlobalAlloc (GMEM_MOVEABLE, errorMessage->length () + 1 );
26+ char *data = (char *) GlobalLock (hMem);
27+ strcpy_s (data, errorMessage->length () + 1 , errorMessage->c_str ());
28+ GlobalUnlock (hMem);
29+ SetClipboardData (CF_TEXT, hMem);
30+ CloseClipboard ();
31+ GlobalFree (hMem);
32+ }
33+ return TRUE ;
3234 }
33- return TRUE ;
34- }
35- break ;
35+ return FALSE ;
3636 default : return FALSE ;
3737 }
38- return FALSE ;
3938}
4039
41- void ErrorHandler::openErrorDialog (const std::string& message) {
40+ void ErrorHandler::openErrorDialog (const std::string & message) {
4241 errorMessage = new std::string (message);
4342 DialogBoxParamA (GetModuleHandle (nullptr ), MAKEINTRESOURCE (IDD_ERROR_DIALOG), Renderer::hwnd, ErrorDialogHandler, 0 );
4443}
0 commit comments