title: How to test if MIDAS.DLL is loaded?
body: <p>I use Datasnap on Delphi 2007. In a few specific machines when the user try to open the app, he gets the 'Error loading Midas.DLL' error and the app crashes.</p>
  
  <p>I never could identify in what scenario this occurs, because i always distribute MIDAS.DLL with my apps and this file is always present in the same folder than the app EXE.</p>
  
  <p>I know i could uses MidasLib to avoid that, but i can't do this because my app uses a cracking protection that crypto the EXE and ends up not being compatible with Midaslib embedded. So Midaslib is not an option for me.</p>
  
  <p>So what i'm trying to do is to run a small test when the app to check if Midas.DLL is loaded BEFORE the app crashes, so i can be pro-active and register the DLL before the app crashes.</p>
  
  <p>Here is what i tried :</p>
  
  <pre><code>function testMidas : boolean;
  var c : tclientdataset;
  begin
  try 
  c := tclientdataset.create(nil);
  c.loadfromfile('c:\somefile.dat');
  c.free;
  result := true;
  // everything fine
  except
  result := false;
  // problem, do something to fix
  end;
  end;
  </code></pre>
  
  <p>This function works, it will fail if Midas.dll is not loaded and result false, so i  can do something to fix the problem. BUT i want to get the same result without having to call 'loadfromfile'. Only by creating the TClientDataset won't generate an exception.</p>
  
  <p>Any ideas, please ?</p>
  
  <p>Thankas !</p>