title: How to Interfacing SWI Prolog to the Visual Studio 2012
body: <p>I have a program that interfacing SWI-Prolog in Visual Studio. Previously, I used VS2010 (XP) and everything works fine. Then I upgrade my VS to become VS2012 (Win7) and now I have a problem in my code.</p>
  
  <p>When it comes to the following code:</p>
  
  <pre><code>PlEngine.Initialize(param);
  </code></pre>
  
  <p>it always gives me the following exception message:</p>
  
  <pre><code>The specified module could not be found. (Exception from HRESULT: 0x8007007E)
  </code></pre>
  
  <p>Can anybody spot what mistake that I made or if possible some modification that I have to do, due to the upgrading process?</p>
  
  <p>Additional information regarding my code:</p>
  
  <ul>
  <li>I used the most updated swiPLCs library (version: 1.1.60301.0)</li>
  <li>my 'param' in my code above is: string[] param = { "-q", "-f", @"c:\program files (x86)\pl\"};</li>
  <li>I have set the path environment variable to: c:\program files (x86)\pl\ and c:\program files (x86)\pl\bin</li>
  <li>I have this setting in my code:  Environment.SetEnvironmentVariable("SWI_HOME_DIR", Global.g_prologLocation);</li>
  <li>I had the reference to: swiPLcs.dll</li>
  <li>I already tried to use the SWIProlog 64 bit, but I still have the same problem</li>
  </ul>
  
  <p>Any help is really appreciated.</p>
  
  <p>Many thanks</p>