title: Delphi Loadlibrary returns 0 (LastErrorcde=3221225616) What does this mean?
body: <p>I need to use a 3rd party dll in our main app. When I staticly link to the provided DLL it works ok and I can the DLLs exported functions.
  But we don't want our main app dependend on this dll on startup so I tried to dynamicly load the DLL when I need it :</p>
  
  <pre><code>DLLHandle := LoadLibrary('3rdparty.dll');
  ret := GetLastError();
  if DLLHandle = 0 then
  begin
    err := SysErrorMessage(ret);
    Writeln(err);
  end //...
  </code></pre>
  
  <p>but did doesnt work : The LoadLibrary function returns 0 and the LastErrorcode is 3221225616. Because I don't know what I'm doing wrong I tried the same (on the same pc) coded in c and it works : but what doesn't it work with delphi ? :
  I call the same LoadLibrary function on the same dll!</p>
  
  <p>When I monitor with ProcMon I see that the 3rdparty dll gets loaded and that also the dependand dlls of the 3rdparty dll gets loaded. : So windows certainly finds the DLL.
  But somewhere it the loading process it fails : 
  When I try to load the DLL with LoadLibraryEX with DONT_RESOLVE_DLL_REFERENCES or LOAD_LIBRARY_AS_DATAFILE it also works (but I can't offcourse call the needed functions...)</p>
  
  <p>I'm out of ideas : hope you guys can help me further...</p>
  
  <p>thx in adv.
  Kristof</p>