title: Catching native code exceptions in .NET
body: <p>I'm currently working with ffmpeg with a proprietary wrapper and I need to catch native code exceptions that sometimes occur during transcoding procedures etc.</p>
  
  <p>I already read those questions/answers:</p>
  
  <p><a href="https://stackoverflow.com/questions/10517199/cant-catch-native-exception-in-managed-code">https://stackoverflow.com/questions/10517199/cant-catch-native-exception-in-managed-code</a>
  <a href="https://stackoverflow.com/questions/150544/can-you-catch-a-native-exception-in-c-sharp-code">https://stackoverflow.com/questions/150544/can-you-catch-a-native-exception-in-c-sharp-code</a></p>
  
  <p>However, they were not really helpful as the exceptions occur not during a function I call, but in a completely different thread that runs side-by-side in the ffmpeg library and were thrown by additional components such as DirectX. This is somehow a real issue as the exceptions tear down my whole application!</p>
  
  <p>Any help is really appreciated.</p>