02-01-2008 11:36 AM
02-01-2008 04:24 PM
02-02-2008 02:11 PM
02-04-2008 10:11 AM
02-04-2008 12:45 PM
02-04-2008 03:15 PM
02-05-2008 09:13 AM
Got it. Thanks. This is kinda what I was thinking.
I am a bit nervous that a function behaves one way in release and another in debug and the documentation (function panel) does not alert me to this. Makes me wonder if I have projects released that are not doing what I think they are.
Is this issue common? Are there other functions out there that do this? How would I know?
Thanks
02-05-2008 11:14 AM
02-05-2008 11:41 AM
Hi John,
I also want to add to what Jett already wrote that, as far as the documentation is concerned, the return value that you are getting in the release build is the correct return value. The function should return the number of bytes of written. However, in debug mode the user protection is preventing the copying from taking place, and as such it wouldn't make sense to return the number of bytes written, since no byte was actually written.
This is analogous to calling some library function that creates an object handle. Normally, that function would return the handle of the object. But if there's some error in the parameters passed to the function that is caught by the user protection, the function will not create the object at all, and the return value cannot be the object handle. So it must return something else.
This doesn't mean that errors can't also be returned in release mode. Just not the memory-type errors that the C language normally does not catch. Those types of errors are only detected by the user protection feature of debug builds. But other errors can be detected in release builds as well.
Luis