Exceptions like "access violation" are not standard C++ exceptions, they don't have a type and so the only way to catch them is to use catch (...). In addition to enable catching of such exceptions (asynchronous exceptions) in C++ you need to change the Enable C++ Exceptions compiler option from /EHsc (the default) to /EHa (see Project Properties, Configuration Properties, C/C++, Code Generation).
See this MSDN article for more information (and a way to wrap this type of exceptions in C++ Exceptions):
http://msdn.microsoft.com/library/default.asp url=/library/en-us/vclang/html/_core_exception_handling_differences.asp
|