Getting a string from COM dll

BimmerRacer

New member
Joined
Oct 27, 2010
Messages
1
Programming Experience
Beginner
Hi guys,

First post here...I am trying to write some code to pull data out of PVCS Tracker using their toolkit API. I can got some things working (i.e. login to Tracker, get record handles, run file exports, etc) but when it comes to reading actual field values I am getting zip.

Below is their code sample which was written in VB6.

VB.NET:
Declare Function TrkGetNextQueryName Lib "trktooln" (ByVal trkHandle As Integer, ByVal bufferSize As Integer, ByVal queryName As String, ByRef pRecordType As Integer) As Integer
And my calling it is

VB.NET:
        i = 1
        rc = TrkInitQueryNameList(trkHandle)
        While TrkGetNextQueryName(trkHandle, 255, queryName, pRecordType) = TRK_SUCCESS)
            Debug.Print(i & " Query Name : " & queryName)
            i = i + 1
        End While

The call works and runs 7 times as there are 7 piblic queries, but queryName is always "".

I saw something about MarshalAsAttribute as well as StringBuilder class but have not been able to get either to work.

Any help would be great!
 
Back
Top