should compile without warning, if your DlgProc is declared correctly.
Andy
PS If your function is declared correctly, the cast is "safe" as you're just casting your function back to the same type. But the cast could hide a problem, e.g. you forget the CALLBACK and end up using a __cdecl function when a __stdcall one -- which is what CALLBACK is equivalent to -- is expected. and hit stack related problems. So, overall, it's a bad thing to do.
Agreed: Rule of thumb: If you have to cast, you're probably doing it wrong. It is not a golden rule, so it doesn't apply 100% of the time, but it does make you think twice why you need a cast. If you can convince yourself that there is just no other way of doing it, then do the type cast, but only after you have seriously convinced yourself that it is in fact needed.