views:

1041

answers:

2

I have the problem, to get a failed run-time check in Visual C++ 2008 because of casting a too big number to a smaller type. The failure is in an external dll, so I can not fix it there. So how can I switch off this run time check for an external project.

A: 

You can always just turn off the cast to smaller type check in the project settings.

If that doesn't work as the check is compiled into the dll, then you can try linking to the non-debug version dll, as the check can only be on for debug "optimized" build. It might affect your debugging though of course.

KTC
+3  A: 

If the cast (and check) is happening in this DLL which you can't recompile, then you can't easily turn off the check.

The only thing you could do is change the data which you pass to the DLL to avoid the problem. Or patch the binary to disable the check, which probably wouldn't be terribly difficult as that sort of thing goes - are you good with a disassembler?

Will Dean