diff --git a/Source/appfat.cpp b/Source/appfat.cpp index 4b8195fb8..41154a076 100644 --- a/Source/appfat.cpp +++ b/Source/appfat.cpp @@ -568,22 +568,22 @@ void ErrDlg(int template_id, DWORD error_code, char *log_file_path, int log_line log_file_path = size + 1; wsprintf((LPSTR)dwInitParam, "%s\nat: %s line %d", GetErrorStr(error_code), log_file_path, log_line_nr); - if (DialogBoxParam(ghInst, MAKEINTRESOURCE(template_id), ghMainWnd, (DLGPROC)FuncDlg, (LPARAM)dwInitParam) == -1) + if (DialogBoxParam(ghInst, MAKEINTRESOURCE(template_id), ghMainWnd, FuncDlg, (LPARAM)dwInitParam) == -1) app_fatal("ErrDlg: %d", template_id); app_fatal(NULL); } -BOOL __stdcall FuncDlg(HWND hDlg, UINT uMsg, WPARAM wParam, char *text) +BOOL __stdcall FuncDlg(HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM text) { switch (uMsg) { case WM_INITDIALOG: - TextDlg(hDlg, text); + TextDlg(hDlg, (char *)text); break; case WM_COMMAND: - if ((WORD)wParam == 1) { + if (wParam == 1) { EndDialog(hDlg, 1); - } else if ((WORD)wParam == 2) { + } else if (wParam == 2) { EndDialog(hDlg, 0); } break; @@ -612,7 +612,7 @@ void ErrOkDlg(int template_id, DWORD error_code, char *log_file_path, int log_li log_file_path = size + 1; wsprintf((LPSTR)dwInitParam, "%s\nat: %s line %d", GetErrorStr(error_code), log_file_path, log_line_nr); - DialogBoxParam(ghInst, MAKEINTRESOURCE(template_id), ghMainWnd, (DLGPROC)FuncDlg, (LPARAM)dwInitParam); + DialogBoxParam(ghInst, MAKEINTRESOURCE(template_id), ghMainWnd, FuncDlg, (LPARAM)dwInitParam); } void FileErrDlg(const char *error) @@ -622,7 +622,7 @@ void FileErrDlg(const char *error) if (!error) error = ""; - if (DialogBoxParam(ghInst, MAKEINTRESOURCE(IDD_DIALOG3), ghMainWnd, (DLGPROC)FuncDlg, (LPARAM)error) == -1) + if (DialogBoxParam(ghInst, MAKEINTRESOURCE(IDD_DIALOG3), ghMainWnd, FuncDlg, (LPARAM)error) == -1) app_fatal("FileErrDlg"); app_fatal(NULL); @@ -632,7 +632,7 @@ void DiskFreeDlg(char *error) { FreeDlg(); - if (DialogBoxParam(ghInst, MAKEINTRESOURCE(IDD_DIALOG7), ghMainWnd, (DLGPROC)FuncDlg, (LPARAM)error) == -1) + if (DialogBoxParam(ghInst, MAKEINTRESOURCE(IDD_DIALOG7), ghMainWnd, FuncDlg, (LPARAM)error) == -1) app_fatal("DiskFreeDlg"); app_fatal(NULL); @@ -644,7 +644,7 @@ BOOL InsertCDDlg() ShowCursor(TRUE); - nResult = DialogBoxParam(ghInst, MAKEINTRESOURCE(IDD_DIALOG9), ghMainWnd, (DLGPROC)FuncDlg, (LPARAM) ""); + nResult = DialogBoxParam(ghInst, MAKEINTRESOURCE(IDD_DIALOG9), ghMainWnd, FuncDlg, (LPARAM) ""); if (nResult == -1) app_fatal("InsertCDDlg"); @@ -657,7 +657,7 @@ void DirErrorDlg(char *error) { FreeDlg(); - if (DialogBoxParam(ghInst, MAKEINTRESOURCE(IDD_DIALOG11), ghMainWnd, (DLGPROC)FuncDlg, (LPARAM)error) == -1) + if (DialogBoxParam(ghInst, MAKEINTRESOURCE(IDD_DIALOG11), ghMainWnd, FuncDlg, (LPARAM)error) == -1) app_fatal("DirErrorDlg"); app_fatal(NULL); diff --git a/Source/appfat.h b/Source/appfat.h index 8a6724f81..97c498254 100644 --- a/Source/appfat.h +++ b/Source/appfat.h @@ -25,7 +25,7 @@ void DDErrMsg(DWORD error_code, int log_line_nr, char *log_file_path); void DSErrMsg(DWORD error_code, int log_line_nr, char *log_file_path); void center_window(HWND hDlg); void ErrDlg(int template_id, DWORD error_code, char *log_file_path, int log_line_nr); -BOOL __stdcall FuncDlg(HWND hDlg, UINT uMsg, WPARAM wParam, char *text); +BOOL __stdcall FuncDlg(HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM text); void TextDlg(HWND hDlg, char *text); void ErrOkDlg(int template_id, DWORD error_code, char *log_file_path, int log_line_nr); void FileErrDlg(const char *error);