4

I'm found LAPI.ocx in installed directory of Liaison sita gabriel (Airline ticketing system) and add it to my application. but don't exist any document or manual and I don't know how work it. So, when i use connect method rais an error:

An unhandled exception of type 'System.NullReferenceException' occurred in airtixWinApp.exe

I'm using windows 7 and see airtixWinApp.vshost.exe but don't see airtixWinApp.exe. I'm confused to using this OCX... Please help me

  • [What is a `NullReferenceException` and how do I fix it?](http://stackoverflow.com/questions/4660142/what-is-a-nullreferenceexception-and-how-do-i-fix-it) – Soner Gönül Jan 28 '15 at 07:31
  • My question is about using LAPI and how to use it, this ocx is only way to communicate with sita gabriel system and don't exist any document about it. – Mohammad reza Beizavi Jan 28 '15 at 07:38

1 Answers1

2

There is LAPI.html in the same folder. It has some example which I am also trying to use but so far only managed to connect to a session preconfigured in my Liaison installation.

Here is my code so far, which I simply created in an .hta file.

<script language="JavaScript">
    var objLAPI = new ActiveXObject("LiaisonAPI.ctlLAPI");
    if (objLAPI)
    {
        document.write("<div>LAPI Created</div>");
    }
    else
    {
        document.write("<div>LAPI Failed</div>");
    }
    var sessions = objLAPI.GetSessionNames();
    objLAPI.Session = "DYNQAA";
    var objConn = objLAPI.Connect();
    if (!objConn) 
    {
        document.write("Connection Failed");
    } else {
        document.write("<div>Connected</div>");
    }

    var strDynPID = objLAPI.DynamicPID;
    document.write(sessions + strDynPID);

    document.write("<hr>");
    objLAPI.Disconnect();
</script>

It work, but I am yet to figure out how to post actual commands to the terminal and read out its output.

If you do succeed, please kindly let us know.

Thank you Regards Alex