Catching a DLL crash in C/C++

原文:http://stackoverflow.com/questions/4939861/catching-a-dll-crash-in-c-c

 

You can catch AVs with the __try and __except keywords in the MSVC compiler. Not all that useful, you have no idea what kind of damage was done. The state of your program might well be corrupted. The heap might be blown for example, causing subsequent random failure. Hosting the DLL in its own process and using IPC to talk to it is the only decent approach.

你可能感兴趣的:(c/c++)