title: Try does not catch exception in DllImport function
body: <p>I call C++ function from C# project:</p>
  
  <pre><code>[System.Runtime.InteropServices.DllImport("C.dll")]
  public static extern int FillSlist(out string slist);
  </code></pre>
  
  <p>and then</p>
  
  <pre><code>try
  {
    FillSlist(out slist);
  }
  catch
  {
  }
  </code></pre>
  
  <p>C++ dll is protected by third-party tool, so some code is being performed before FillSlist is really executed. Something really bad happens while this third-party code is executed and the program stops working at all. Neither "try" isolates the problem nor "AppDomain.CurrentDomain.UnhandledException" is executed.</p>
  
  <p>Is there anything that can help to isolate crash of C++ function from C# calling code?</p>