title: Interface between C# and SWI-Prolog
body: <p>I have written a prolog program and I want to use the program within C#, that is i want to ask queries to swi-prolog and use answers within my C# code... </p>
  
  <p>I have tried SWI-Prolog interface to C# at : <a href="http://www.swi-prolog.org/contrib/CSharp.html" rel="nofollow">http://www.swi-prolog.org/contrib/CSharp.html</a></p>
  
  <p>My code is like as follows....:</p>
  
  <pre><code>    Environment.SetEnvironmentVariable("SWI_HOME_DIR", @"C:\Program Files (x86)\swipl\");
  
      if (!PlEngine.IsInitialized)
              {
                  try
                 {
                    SbsSW.SwiPlCs.PlEngine.Initialize(new string[] { "" });
                }
                 catch (System.Exception ex)
                  {
                      Console.WriteLine("Failure initializing Prolog: " + ex.Message);
                     // return;
                 }
              }
            Console.ReadLine();
      }
  </code></pre>
  
  <p>But I get this error : "is not a valid Win32 application. (Exception from HRESULT:0x800700C1" </p>
  
  <p>I use 64 bit windows 7  ... What to do? now?</p>
  
  <p>Thanks in advance</p>