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

Transition from Imap.CheckForNewEmail to Imap.QueryMbx

Provides instructions for replacing deprecated CheckForNewEmail method calls with QueryMbx.

Chilkat Xbase++ Downloads

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

nSuccess := 0

oImap := CreateObject("Chilkat.Imap")

//  ...
//  ...

//  ------------------------------------------------------------------------
//  The CheckForNewEmail method is deprecated:

oMsgSetObj := oImap:CheckForNewEmail()
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.

cCriteria := "new-email"
nBUid := 1

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

oImap:destroy()
oMsgSet:destroy()