title: DLLImport error: System.AccessViolationException with Manifest file and c#
body: <p>When trying to call (DLLImport) an external c++ dll from a .net application that has a manifest file with requireAdministrator, I get this error trying to call function from the C++ dll in Windows 7 with UAC enabled.</p>
  
  <p>Method I am calling: <code>EnCrypts</code></p>
  
  <p>Exception:</p>
  
  <blockquote>
    <p>System.AccessViolationException: Attempted to read or write protected
    memory. This is often an indication that other memory is corrupt.</p>
  </blockquote>
  
  <p>Code:</p>
  
  <pre><code>public class BlowFish
  {
      [DllImport("BlowfishTool.dll", CharSet = CharSet.Auto)]
      public static extern String EnCrypt(String strData, String strPassword);
  
      [DllImport("BlowfishTool.dll", CharSet = CharSet.Auto)]
      public static extern String EnCrypt(String strData, String strPassword, bool doNotUsePassChecking);
  
      [DllImport("BlowfishTool.dll", CharSet = CharSet.Auto)]
      public static extern String DeCrypt(String strData, String strPassword, bool doNotUsePassChecking);
  
      [DllImport("BlowfishTool.dll", CharSet = CharSet.Auto)]
      public static extern String DeCrypt(String strData, String strPassword);
  
  
      public static String EnCrypts(String strData, String strPassword)
      {
          return EnCrypt(strData, strPassword, true);
      }
  }
  </code></pre>