|
DigiPara Liftdesigner LDX API
|
' from Samples/Src/LDXAPIExamples/Example_LDOOP.vb
<APIHelpAttribute(APIHelpModes.None, {APIHelpModes.None}, "", "LDXApplication~Example_LDOOP", "Use LDOOP to get headless LDX Application")>
Public Shared Sub LDOOP()
' In a standalone application, or most likely in a web app, you do not get served an LDXApplication.
' You have to make one yourself, and the way to do so is over LDOOP.
' reference Interop.LDOOP.dll, set 'embed interop types' to 'false'
Dim ldoopServer As LDOOP.ILDOOPServer = New LDOOP.LDOOPServerClass()
' retrieve LDX application
' here in VB.NET, the cast from object/IDispatch to LDXApplication via QueryInterface happens implicitly,
' in C# you need an "as LDX.LDXApplication" cast.
Dim ldxApp As LDX.LDXApplication = ldoopServer.Application5
' it is running in a separate LDOOP.exe process and accessed over an internal network link.
MessageBox.Show("Pool Path : " + ldxApp.PoolPath)
' you have to regularly send keepalive signals to ldoopserver, one per minute is enough
ldoopServer.NotifyStillLiving()
' When you are done, close the ldoopServer to shut down the process (it will close itself after a while of not receiving NotifyStillLiving()).
' Shutdown is not immediate, it takes about a minute.
ldoopServer.Quit()
End Sub