Hi,
I tried to use Citect CTAPI in Microsoft VB6 SP3 but fail. VB crashes each time the program terminates after calling one or more CTAPI functions. The problem is easily reproduced using the following code simply pasted in a new VB project:
'---------------------------------------------------------------------------
------------------ Option Explicit Private Declare Function ctOpen Lib "ctapi" (ByVal sServer As String, ByVal sUser As String, ByVal sPassword As String, ByVal lType As Long) As Long Private Declare Function ctClose Lib "ctapi" (ByVal lCtHandle) As Boolean Dim lCtHandle As Long
Private Sub Form_Load() lCtHandle = ctOpen("", "", "", 0) If lCtHandle = 0 Then MsgBox "Citect is not running" End Sub
Private Sub Form_Unload(Cancel As Integer) If lCtHandle 0 Then ctClose lCtHandle End Sub
'---------------------------------------------------------------------------
------------------
- Do anyone have any experience of using CTAPI in VB?
- Any other comments or solutions?
/Sven