This is typically the case when casting a function pointer to shut up the compiler when calling a Windows API, such as DialogBox:
DialogBox(hInstance, MAKEINTRESOURCE(MY_DIALOG), hWnd, &dlgProc);
Windows is a bit odd in that all functions are defined with the stdcall calling-convention, contrary to cdecl, the default in C. Therefor all functions that should be passed to a Windows API should be defined with WINAPI (a define for stdcall):
INT_PTR WINAPI dlgProc(HWND, UINT, WPARAM, LPARAM);
If you miss that and instead define your dlgProc as:
INT_PTR dlgProc(HWND, UINT, WPARAM, LPARAM);
Your code won't compile and you might be sorely tempted to just shut the frikkin' compiler up:
DialogBox(hInstance, MAKEINTRESOURCE(MY_DIALOG), hWnd, (DLGPROC)&dlgProc); // be a DLGPROC already, dammit!!
Don't do that. The program will crash. The compiler is your friend. The C-style cast operator is not. The compiler tried to tell you this was going to happen. And it was right. Listen to it.