Sample code for 30+ languages & platforms
Visual Basic 6.0 Requires Chilkat v11.0.0+

Transition from Imap.ThreadCmd to Imap.QueryThread

Provides instructions for replacing deprecated ThreadCmd method calls with QueryThread.

Chilkat Visual Basic 6.0 Downloads

Visual Basic 6.0
Dim success As Long
success = 0

Dim imap As New ChilkatImap

'  ...
'  ...

Dim threadAlg As String
threadAlg = "REFERENCES"
Dim charset As String
charset = "UTF-8"
Dim searchCriteria As String
searchCriteria = "SUBJECT a"
Dim bUid As Long
bUid = 1

'  ------------------------------------------------------------------------
'  The ThreadCmd method is deprecated:

Dim jsonObj As ChilkatJsonObject
Set jsonObj = imap.ThreadCmd(threadAlg,charset,searchCriteria,bUid)
If (imap.LastMethodSuccess = 0) Then
    Debug.Print imap.LastErrorText
    Exit Sub
End If

'  ...
'  ...

'  ------------------------------------------------------------------------
'  Do the equivalent using QueryThread.
'  Your application creates a new, empty JsonObject object which is passed 
'  in the last argument and filled upon success.

imap.SearchCharset = "UTF-8"

Dim json As New ChilkatJsonObject
success = imap.QueryThread(threadAlg,searchCriteria,bUid,json)
If (success = 0) Then
    Debug.Print imap.LastErrorText
    Exit Sub
End If