title: File not found when loading dll from vb6
body: <p>I am declaring and calling a dll function using the following syntax in VB6:</p>
  
  <pre><code>'Declare the function
  Private Declare Sub MYFUNC Lib "mylib.dll" ()
  
  'Call the function
  MYFUNC
  </code></pre>
  
  <p>Calling the function results in the error <code>File not found: mylib.dll</code>.  This happens when the application is run from the vb6 IDE or from a compiled executable.</p>
  
  <p>The dll is in the working directory, and I have checked that it is found using ProcMon.exe from sysinternals.  There are no failed loads, but the Intel Fortran dlls are not loaded (the ProcMon trace seems to stop before then).</p>
  
  <p>I have also tried running the application in WinDbg.exe, and weirdly, it works!  There are no failures on this line.  The ProcMon trace shows that the Intel Fortran dlls are loaded when the program is run in this way.</p>
  
  <p>The dll is compiled with Fortran Composer XE 2011.</p>
  
  <p>Can anyone offer any help?</p>