Issue initializing Prolog Engine in Visual C#
Every time i run the following code i get a FileNotFoundException was unhandled
(Exception from HRESULT 0x8007007E)
I have set the enviromnet variable to point to the bin location
How can i fix this ? Any help would be highly appreciated
using System;
using System.IO;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using SbsSW.SwiPlCs;
using SbsSW.SwiPlCs.Exceptions;
namespace WTSS
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
StreamReader myFile = new StreamReader("c:\\TS.pl");
string myString = myFile.ReadToEnd();
myFile.Close();
// build the parameter string to Initialize PlEngine with the generated file
string[] param = { "-q", "-f", myString };
Environment.SetEnvironmentVariable("SWI_HOME_DIR", @"c:\\program files\pl\boot32.prc");
PlEngine.Initialize(param);
if (!PlEngine.IsInitialized)
{
MessageBox.Show("Sorry: Cannot initialize Prolog engine");
}
}
}
}