title: pinvoke c function - System.BadImageFormatException
body: <p>Im trying to call a C function from C# but im getting a BadImageFormatException.</p>
  
  <p>Here is by C function header:</p>
  
  <pre><code>extern "C"
  {
      __declspec(dllexport) bool validate(char key[]);
  }
  </code></pre>
  
  <p>Here is how im calling it from C#</p>
  
  <pre><code>[DllImport("MyDll.dll")]
  static extern bool validate(char[] key);
  </code></pre>
  
  <p>Whats wrong here.</p>