Contents Previous Next Subchapters

Create a Connection with an O-Matrix Server
Syntax status = OMServer.Open
See Also comclose , and comtimeout

Initialize the O-Matrix COM server and creates a connection to a running instance of O-Matrix. O-Matrix must be running before calling this function. The returned value status is an integer OM Server Status code. This value will equal 1 if a connection was successfully established.

Start Visual Basic and create a new project. Bind to the O-Matrix server type library by selecting OMatrixServer Type Library from the 'Project | References' dialog. In the Project Properties dialog select Sub Main from the Startup Object field. Add a new module to the project and paste the following code into the new module.

Public OM As New OMServer

Sub Main()
    Dim status As Integer
    status = OM.Open
    If status = 1 Then
        MsgBox ("Connection to O-Matrix established")
        MsgBox ("Unable to establish connection to O-Matrix")
    End If
End Sub

Press the F5 key and your application will post a dialog displaying the connection status.