title: SEHException with simple DLL
body: <p>I am currently trying to use a simple C++ DLL in a C# program for a school project but I have trouble making the DLL and Program link with each other. When I try to call the DLL's function in the main program, I get a SEHExcpetion thrown from the DLL.</p>
  
  <p>Here is the DLL code</p>
  
  <pre><code>#include &lt;stdio.h&gt;
  #include &lt;string&gt;
  
  using namespace std;
  
  extern "C"
  {
      __declspec(dllexport) string Crypter(string sIn)
      {
          return sIn+ " from DLL";
      }
  }  
  </code></pre>
  
  <p>And here's the C# code</p>
  
  <pre><code>using System;
  using System.Collections.Generic;
  using System.ComponentModel;
  using System.Data;
  using System.Drawing;
  using System.Linq;
  using System.Text;
  using System.Windows.Forms;
  using System.Runtime.InteropServices;
  
  namespace WindowsFormsApplication1
  {
      public partial class Form1 : Form
      {
          [DllImport("CryptoDLL2.dll")]
          public static extern string Crypter(string sIn);
  
          public Form1()
          {
              InitializeComponent();
          }
  
          private void BTN_Crypter_Click(object sender, EventArgs e)
          {
              TB_OUT.Text = ("");
              TB_OUT.Text = Crypter(TB_IN.Text); //exception thrown here
          }
      }
  }
  </code></pre>