diff --git a/src/Dialog.cpp b/src/Dialog.cpp index 9a104089..999f8742 100644 --- a/src/Dialog.cpp +++ b/src/Dialog.cpp @@ -17,7 +17,7 @@ static const char *version_string = ; // TODO - Inaccurate stack frame -INT_PTR CALLBACK VersionDialog(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam) +DLGPROC_RET CALLBACK VersionDialog(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam) { char string_buffer[104]; @@ -58,7 +58,7 @@ INT_PTR CALLBACK VersionDialog(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam return FALSE; } -INT_PTR CALLBACK DebugMuteDialog(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam) +DLGPROC_RET CALLBACK DebugMuteDialog(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam) { (void)lParam; @@ -102,7 +102,7 @@ INT_PTR CALLBACK DebugMuteDialog(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lPar return FALSE; } -INT_PTR CALLBACK DebugSaveDialog(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam) +DLGPROC_RET CALLBACK DebugSaveDialog(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam) { char string[100]; @@ -135,7 +135,7 @@ INT_PTR CALLBACK DebugSaveDialog(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lPar return FALSE; } -INT_PTR CALLBACK QuitDialog(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam) +DLGPROC_RET CALLBACK QuitDialog(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam) { switch (Msg) { diff --git a/src/Dialog.h b/src/Dialog.h index 628d59e7..1c5b6914 100644 --- a/src/Dialog.h +++ b/src/Dialog.h @@ -2,7 +2,7 @@ #include "WindowsWrapper.h" -INT_PTR CALLBACK VersionDialog(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam); -INT_PTR CALLBACK DebugMuteDialog(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam); -INT_PTR CALLBACK DebugSaveDialog(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam); -INT_PTR CALLBACK QuitDialog(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam); +DLGPROC_RET CALLBACK VersionDialog(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam); +DLGPROC_RET CALLBACK DebugMuteDialog(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam); +DLGPROC_RET CALLBACK DebugSaveDialog(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam); +DLGPROC_RET CALLBACK QuitDialog(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam); diff --git a/src/Main.cpp b/src/Main.cpp index 806607ed..1d5bcd89 100644 --- a/src/Main.cpp +++ b/src/Main.cpp @@ -676,12 +676,12 @@ LRESULT CALLBACK WindowProcedure(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lPar switch (LOWORD(wParam)) { case 40001: - if (DialogBoxParamA(ghInstance, "DLG_YESNO", hWnd, (DLGPROC)QuitDialog, (LPARAM)"Quit?") == 1) + if (DialogBoxParamA(ghInstance, "DLG_YESNO", hWnd, QuitDialog, (LPARAM)"Quit?") == 1) PostMessageA(hWnd, WM_CLOSE, 0, 0); break; case 40002: - DialogBoxParamA(ghInstance, "DLG_ABOUT", hWnd, (DLGPROC)VersionDialog, 0); + DialogBoxParamA(ghInstance, "DLG_ABOUT", hWnd, VersionDialog, 0); break; case 40004: @@ -690,11 +690,11 @@ LRESULT CALLBACK WindowProcedure(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lPar break; case 40005: - DialogBoxParamA(ghInstance, "DLG_SAVE", hWnd, (DLGPROC)DebugSaveDialog, 0); + DialogBoxParamA(ghInstance, "DLG_SAVE", hWnd, DebugSaveDialog, 0); break; case 40007: - DialogBoxParamA(ghInstance, "DLG_MUTE", hWnd, (DLGPROC)DebugMuteDialog, 0); + DialogBoxParamA(ghInstance, "DLG_MUTE", hWnd, DebugMuteDialog, 0); break; } diff --git a/src/WindowsWrapper.h b/src/WindowsWrapper.h index 22321292..b182e51b 100644 --- a/src/WindowsWrapper.h +++ b/src/WindowsWrapper.h @@ -3,7 +3,7 @@ #include // Visual Studio 6 is missing these, so define them here -#ifdef _MSC_VER +#if defined(_MSC_VER) && _MSC_VER <= 1200 #ifndef VK_OEM_PLUS #define VK_OEM_PLUS 0xBB #endif @@ -23,4 +23,9 @@ #ifndef DWORD_PTR #define DWORD_PTR DWORD #endif + + // DLGPROC went from returning BOOL to INT_PTR in later versions, and VC6 doesn't like that + #define DLGPROC_RET BOOL +#else + #define DLGPROC_RET INT_PTR #endif