Sample code for 30+ languages & platforms
Xbase++ Requires Chilkat v11.0.0+

Transition from Imap.Search to Imap.QueryMbx

Provides instructions for replacing deprecated Search method calls with QueryMbx.

Chilkat Xbase++ Downloads

Xbase++
LOCAL nSuccess
LOCAL oImap
LOCAL cCriteria
LOCAL nBUid
LOCAL oMsgSetObj
LOCAL oMset

nSuccess := 0

oImap := CreateObject("Chilkat.Imap")

//  ...
//  ...

cCriteria := "FROM bob@example.com"
nBUid := 1

//  ------------------------------------------------------------------------
//  The Search method is deprecated:

oMsgSetObj := oImap:Search(cCriteria, nBUid)
IF (oImap:LastMethodSuccess == 0)
    ? oImap:LastErrorText
    oImap:destroy()
    RETURN
ENDIF

//  ...
//  ...

oMsgSetObj:destroy()

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

oMset := CreateObject("Chilkat.MessageSet")
nSuccess := oImap:QueryMbx(cCriteria, nBUid, oMset)
IF (nSuccess == 0)
    ? oImap:LastErrorText
    oImap:destroy()
    oMset:destroy()
    RETURN
ENDIF

oImap:destroy()
oMset:destroy()