title: Getting error " Attempted to read or write protected memory"
body: <p>This is what is in the header file.</p>
  
  <pre><code>/// Creates a new file geodatabase in the specified location.
  /// @param[in]    path The location where the geodatabase should be created.
  /// @param[out]   geodatabase A reference to the newly-created geodatabase.
  /// @return       A long integer indicating whether the method finished successfully.
  EXT_FILEGDB_API long CreateGeodatabase(const std::wstring&amp; path, Geodatabase&amp; geodatabase);
  </code></pre>
  
  <p>This is what my dllimport looks like.</p>
  
  <pre><code>[DllImport("FileGDBAPI.dll", EntryPoint = "#49", SetLastError=true, CallingConvention=CallingConvention.Winapi)]
          public static extern int CreateGeodatabase([MarshalAs(UnmanagedType.LPStr)]string path, ref IntPtr geodatabase);
  </code></pre>
  
  <p>..and this is the code thats using it.</p>
  
  <pre><code>IntPtr Geodatabase = IntPtr.Zero;
                  FileGDBAPI_wrapper.CreateGeodatabase("c:\temp\testGDB.gdb", ref Geodatabase);
  </code></pre>
  
  <p>What am I doing wrong?</p>