title: 64 bit dll in 64 bit process Vista fails - Unable to load DLL 'dllname': The specified module could not be found
body: <p>I have a native C code, I compiled the code in vc++ 2008 and its compiled with 'x64' as platform in configuration manager and I have an c# application which is also compiled with 'x64' as platform and it calls the dll function. I have used Dllimport to call the function from the dll like below.</p>
  
  <pre><code>using System.Runtime.InteropServices;
  
  namespace test            
  {    
  public partial class Form1 : Form                                                     
    {
  
        [DllImport("mtest", CharSet = CharSet.Ansi)]
          public extern static void e_path(string path);
  
          public Form1()
          {
              InitializeComponent();
          }
          private void button1_Click(object sender, EventArgs e)
          {
              MessageBox.Show("test");
              swe_set_ephe_path("E:\\Gan");
          }
      }
  }
  </code></pre>
  
  <p>at the time of running the application I am getting the error as below:</p>
  
  <p>An unhandled exception of type 'System.DllNotFoundException' occurred in test.exe</p>
  
  <p>Additional information: Unable to load DLL 'mydll': The specified module could not be found. (Exception from HRESULT: 0x8007007E)</p>
  
  <p>Could any you please help me out to resolve this. If I run both the dll and the applicaition its working fine. But I need the dll functions to be called from my ASP pages so I need both the dll and application as 64 bit. </p>
  
  <p><strong>ADDITIONAL INFORMATION :</strong> when I checked the dll for dependency using dependency walker for 64-bit It shows that the Kernel32.dll and NTDLL.DLL and mydll.dll is x64.</p>
  
  <p>please help me out with this.</p>
  
  <p>Thanks in Advance,</p>