CTAPI (Citect API) in VB, HELP NEEDED!!

I try to use Citect CTAPI in Microsoft VB6 SP3 but fail. A few functions work, like ctOpen, ctClose and ctTagWrite.
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 Private Declare Function ctTagWrite Lib "ctapi" (ByVal lCtHandle As Long, ByVal sTag As String, ByVal sValue As String) As Boolean
I think I need to use the functions ctTagRead, ctStrToPoint, ctTagToPoint, ctPointRead, ctPointClose, ctPointToStr, ctPointWrite, ctRawToEng and ctCicode, but am focusing on ctTagRead to start with:
The c declaration for ctTagRead is: BOOL ctTagRead(hCTAPI, sTag, sValue, dwLength)
One c example from the Citect help is: ctTagRead(hCTAPI, "PV123", sProcessValue, sizeof(sProcessValue));
I have tried several alternatives, but this is my current code part: Private Declare Function ctTagRead Lib "ctapi" (ByVal lCtHandle As Long, ByVal sTag As String, ByRef sValue As String, ByVal lLength As Long) As Boolean Dim sValue As String * 80 ctTagRead lCtHandle, "MyCitectTag", sValue, Len(sValue)
This makes CTAPI crash. sValue must be declared as ByRef to make possible for CTAPI to return the value there. I use fixed length string because of experience from other c dll's in VB.
I need correct VB declarations for ctTagRead and the other remaining functions and/or some sample VB code. Or any suggestions!! If anyone used CTAPI in VB, please e-mail me (just remove NOSPAM from my e-mail address) or post an answer here!
If you need the Citect software, it's available for free at www.citect.com .
/Sven
Add pictures here
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>
Add image file
Upload
They are usually pretty quick respondinng and will give you the right answers and not just our guesses.
Good luck!
Cameron:-)
Add pictures here
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>
Add image file
Upload
--- Clearification: --- You misinterpreted my question. I use Microsoft Visual Basic 6.0 writing an own software. This software needs to communicate with one or more Citect applications. So I use the Citect CTAPI. Yes, I also asked Citect and yes they are answering pretty fast, but I also think that this kind of questions fit well in this group.
--- Cicode: --- Cicode is one of the two script languages in Citect. The other is Cypress VBA.
They are usually pretty quick respondinng and will

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.