DataFlex
DataFlex
Transition from Imap.FetchHeaders to Imap.FetchMsgSet
Provides instructions for replacing deprecated FetchHeaders method calls with FetchMsgSet.Chilkat DataFlex Downloads
Use ChilkatAx-win32.pkg
Procedure Test
Boolean iSuccess
Handle hoImap
Variant vMset
Handle hoMset
Variant vBundleObj
Handle hoBundleObj
Boolean iHeadersOnly
Variant vBundleOut
Handle hoBundleOut
String sTemp1
Boolean bTemp1
Move False To iSuccess
Get Create (RefClass(cComChilkatImap)) To hoImap
If (Not(IsComObjectCreated(hoImap))) Begin
Send CreateComObject of hoImap
End
// ...
// ...
Get Create (RefClass(cComChilkatMessageSet)) To hoMset
If (Not(IsComObjectCreated(hoMset))) Begin
Send CreateComObject of hoMset
End
Get pvComObject of hoMset to vMset
Get ComQueryMbx Of hoImap "FROM joe@example.com" True vMset To iSuccess
// ...
// ...
// ------------------------------------------------------------------------
// The FetchHeaders method is deprecated:
Get pvComObject of hoMset to vMset
Get ComFetchHeaders Of hoImap vMset To vBundleObj
If (IsComObject(vBundleObj)) Begin
Get Create (RefClass(cComChilkatEmailBundle)) To hoBundleObj
Set pvComObject Of hoBundleObj To vBundleObj
End
Get ComLastMethodSuccess Of hoImap To bTemp1
If (bTemp1 = False) Begin
Get ComLastErrorText Of hoImap To sTemp1
Showln sTemp1
Procedure_Return
End
// ...
// ...
Send Destroy of hoBundleObj
// ------------------------------------------------------------------------
// Do the equivalent using FetchMsgSet.
// Your application creates a new, empty EmailBundle object which is passed
// in the last argument and filled upon success.
Move True To iHeadersOnly
Get Create (RefClass(cComChilkatEmailBundle)) To hoBundleOut
If (Not(IsComObjectCreated(hoBundleOut))) Begin
Send CreateComObject of hoBundleOut
End
Get pvComObject of hoMset to vMset
Get pvComObject of hoBundleOut to vBundleOut
Get ComFetchMsgSet Of hoImap iHeadersOnly vMset vBundleOut To iSuccess
If (iSuccess = False) Begin
Get ComLastErrorText Of hoImap To sTemp1
Showln sTemp1
Procedure_Return
End
End_Procedure