CTAPI in VB?

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
'--------------------------------------------------------------------------- ------------------
1. Do anyone have any experience of using CTAPI in VB? 2. Any other comments or solutions?
/Sven
Add pictures here
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>
Add image file
Upload
After a tip, I got ctOpen and ctClose to work.
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 Long) As Boolean
I think I need to use the following functions:
ctTagRead ctTagWrite
ctStrToPoint ctTagToPoint ctPointRead ctPointClose ctPointToStr ctPointWrite ctRawToEng
ctCicode
I need VB declarations for them and some sample VB code if possible. If anyone used CTAPI in VB, please e-mail me (just remove NOSPAM from my e-mail address) or post an answer here!
/Sven
Add pictures here
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>
Add image file
Upload
See my new posting "CTAPI (Citect API) in VB, HELP NEEDED!!" dated October 14, 2003 at 12:30 CET.
/Sven
Add pictures here
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>
Add image file
Upload

Polytechforum.com is a website by engineers for engineers. It is not affiliated with any of manufacturers or vendors discussed here. All logos and trade names are the property of their respective owners.