Gunnar Kudrjavets wrote a very informative post the other day discussing how to direct assertions to file or debug output.
Well, how to still make sure that assertions will be triggered when appropriate, but not to have any visual side-effects? Fortunately C run-time library provides you everything you need: _Crt* functions are the key, especially _CrtSetReportMode and _CrtSetReportFile, and also the documentation about CRT assertion macros.

I love one of his conclusions...
Moral of the story: one should read more MSDN and/or CRT source code.