Exception handling problem

Hi all,
I am having a spot of trouble with my exception handlers - they don't seem to working in release mode! In debug mode the exception block is executed, but in release mode, the application just shutsdown. I am currently testing this problem with the following code which deliberately throws an exception:

try {
char* sz = NULL;
tstrcpy(sz, "foo");
} catch (...) {
// handle exception and pop up message
}

This *only* fails on release mode. I suspect this is something to do with my Visual Studio settings (2005), but I can't for the life of me figure out what. I have tried turning off optimization and catching specific exceptions - no help. I have also trie Structured Exception Handling with __try __except. This, interestingly, has the exact same result - works in debug, not in release.

All comments and suggestions would be most appreciated.
BJW
[931 byte] By [sockman] at [2007-11-20 11:52:39]