08-03-2022 06:38 AM
Hello,
I've written a C# program as user interface. The program runs VBAI Engine. Sometiimes Engine can't open the vbai file. After restarting Windows 10 programs work fine again. Has anyone ID?
08-08-2022 08:29 AM
After failing in loading that inspection file, did you try loading it from the VBAI interface instead ?
And by the way , did you check that the file wasn't already loaded (in another vbai instance) ?
Sami
08-17-2022 01:16 PM
No, I did not try to open the inspection in Vision Builder after fail. But I always check if inspection is open in engine before I try to open. My program enters into catch thread: Another interesting thing. Sometimes I could not close. So, I have to kill every process named Vision Builder when my program starts. 🙂
private int SetInspection(string VBAIEnginePath) //Beállítjuk az inspection-t
{
InspectionInfo ActualInspectionInfo;
try
{
WriteLocalLog("Checking current loaded inspection path. " + VBAIEnginePath + " VBStatus=" + VBStatus.ToString(), false);
ActualInspectionInfo = engine.GetInspectionInfo();
}
catch
{
WriteLocalLog("Checking current loaded inspection path is fail. " + VBAIEnginePath + " VBStatus=" + VBStatus.ToString(), true);
return 1;
}
if (VBAIEnginePath != ActualInspectionInfo.path)
{
WriteLocalLog("Actual opened path is different or no opened inspection. " + "VBStatus=" + VBStatus.ToString(), false);
if (System.IO.File.Exists(VBAIEnginePath))
{
try
{
WriteLocalLog("Setting rider's combo box to last selected item... " + "VBStatus=" + VBStatus.ToString(), false);
engine.OpenInspection(VBAIEnginePath);
return 0;
}
catch
{
WriteLocalLog("Can't open the inspection, named: " + VBAIEnginePath + " VBStatus=" + VBStatus.ToString(), true);
return 2;
}
}
else
{
WriteLocalLog("Inspection does not exists. " + "VBStatus=" + VBStatus.ToString(), true);
return 9;
}
}
return 0;
}