Hello. I'm using vb5 professional edition and whenever my program terminates, the entire vb design environment terminates with it! No errors are being generated within my program. It's is accessing a DLL. Here is the code:

Option Explicit

Dim session As Object

Private Sub cmdLogon_Click()

On Error GoTo logon_error
If txtServer.Text = "" Or txtUser.Text = "" Or txtPass.Text = "" Then
MsgBox "Please input server, user and password."
Else
session.CTLogon txtServer.Text, txtUser.Text, txtPass.Text
End If

Exit Sub
logon_error:
MsgBox "Error # " & CStr(Err.Number) & " " & Err.Description
Err.Clear
Exit Sub
End Sub

Private Sub Form_Load()
Set session = CreateObject("CTI.Session.1")
End Sub

Private Sub form_terminate()
Set session = Nothing
End Sub