title: LoadLibrary fails and dependency walker does not help
body: <p>I was trying to use QOCI plugin for QtSql, until I had some problems:
  <a href="https://stackoverflow.com/questions/6227426/why-qoci-plugin-isnt-working">Why QOCI plugin isn&#39;t working</a></p>
  
  <p>However it turned out that it is a library loading issue (at least I think so), so I decided to change the subject of the question since it is a new question.</p>
  
  <p>I have a dll file (called qsqloci4.dll) When I try to load it with LoadLibrary, it fails and GetLastError returns ERROR_MOD_NOT_FOUND. When I try to load it with LoadLibraryEx and 3rd parameter is DONT_RESOLVE_DLL_REFERENCES, <em>it loads successfully</em> (does not return NULL).</p>
  
  <p>So, i thought it is a dependency issue. I opened the dll file with dependency walker, there were 2 files that couldn't be located: QtCore4.dll and QtSql4.dll.
  However, these files are in the working directory of application, and other dll files which are dependent on those dlls (such as qsqlpsql4.dll) are successfully loaded.</p>
  
  <p>Other dlls (which are located by dependency walker) are:</p>
  
  <ul>
  <li>oci.dll : is in same folder as QtCore4.dll and QtSql4.dll, means my app can access it</li>
  <li>kernel32.dll : i believe the easiest dll to locate by my app</li>
  <li>msvscr80.dll : other dll files which use this can be loaded successfully.</li>
  </ul>
  
  <p>Here is my question: given dependency walker says : "you have all dlls except qt ones" and i am sure that I have qt dlls, what other reason can be for LoadLibrary to fail with ERROR_MOD_NOT_FOUND?</p>