Sample code for 30+ languages & platforms
PowerBuilder

Transition from Imap.FetchBundle to Imap.FetchMsgSet

Provides instructions for replacing deprecated FetchBundle method calls with FetchMsgSet.

Chilkat PowerBuilder Downloads

PowerBuilder
integer li_rc
integer li_Success
oleobject loo_Imap
oleobject loo_Mset
oleobject loo_BundleObj
integer li_HeadersOnly
oleobject loo_BundleOut

li_Success = 0

loo_Imap = create oleobject
li_rc = loo_Imap.ConnectToNewObject("Chilkat.Imap")
if li_rc < 0 then
    destroy loo_Imap
    MessageBox("Error","Connecting to COM object failed")
    return
end if

// ...
// ...

loo_Mset = create oleobject
li_rc = loo_Mset.ConnectToNewObject("Chilkat.MessageSet")

li_Success = loo_Imap.QueryMbx("FROM joe@example.com",1,loo_Mset)
// ...
// ...

// ------------------------------------------------------------------------
// The FetchBundle method is deprecated:

loo_BundleObj = loo_Imap.FetchBundle(loo_Mset)
if loo_Imap.LastMethodSuccess = 0 then
    Write-Debug loo_Imap.LastErrorText
    destroy loo_Imap
    destroy loo_Mset
    return
end if

// ...
// ...

destroy loo_BundleObj

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

li_HeadersOnly = 0

loo_BundleOut = create oleobject
li_rc = loo_BundleOut.ConnectToNewObject("Chilkat.EmailBundle")

li_Success = loo_Imap.FetchMsgSet(li_HeadersOnly,loo_Mset,loo_BundleOut)
if li_Success = 0 then
    Write-Debug loo_Imap.LastErrorText
    destroy loo_Imap
    destroy loo_Mset
    destroy loo_BundleOut
    return
end if



destroy loo_Imap
destroy loo_Mset
destroy loo_BundleOut