title: VC++-MFC : LoadLibrary returns invalid handle 0x10000000
body: <p>I am unable to load my test.dll (in VC++ - MFC) using <code>LoadLibrary()</code> API. I get error code <code>126 (Module not found)</code>using <code>GetLastError()</code>.
  By dependency walker I have come to know that my test.dll depends on "xerces-c_2_7.dll" and "Xalan-C_1_10.dll". These dlls were already present on the same path as the exe.
  Still I am getting the error.
  So I tried to load both the above mentioned third party dlls using <code>LoadLibrary()</code> which returned handle as <code>0x10000000</code>. By <code>GetLastError()</code> I am getting </p>
  
  <pre><code>error code 6 (Invalid Handle).
  </code></pre>
  
  <p>Can anyone please guide me on why I am getting the Invalid Handle error?</p>
  
  <p>Below is the code snipet:</p>
  
  <pre><code>HINSTANCE hLib = LoadLibrary(_T("Xalan-C_1_10"));
  TCHAR szMessage[MAX_PATH];
  FormatMessage(FORMAT_MESSAGE_IGNORE_INSERTS|
      FORMAT_MESSAGE_FROM_SYSTEM,
      NULL, GetLastError(),
      MAKELANGID(LANG_NEUTRAL, SUBLANG_NEUTRAL),
      szMessage, MAX_PATH, NULL);
      hLib = LoadLibrary(_T("xerces-c_2_7"));
  FormatMessage(FORMAT_MESSAGE_IGNORE_INSERTS|
      FORMAT_MESSAGE_FROM_SYSTEM,
      NULL, GetLastError(),
      MAKELANGID(LANG_NEUTRAL, SUBLANG_NEUTRAL),
      szMessage, MAX_PATH, NULL);
  </code></pre>