Sample code for 30+ languages & platforms
PowerBuilder

Transition from Email.CreateForward to Email.ToForward

Provides instructions for replacing deprecated CreateForward method calls with ToForward.

Chilkat PowerBuilder Downloads

PowerBuilder
integer li_rc
integer li_Success
oleobject loo_Email
oleobject loo_EmailObj
oleobject loo_EmailOut

li_Success = 0

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

// ...
// ...

// ------------------------------------------------------------------------
// The CreateForward method is deprecated:

loo_EmailObj = loo_Email.CreateForward()
if loo_Email.LastMethodSuccess = 0 then
    Write-Debug loo_Email.LastErrorText
    destroy loo_Email
    return
end if

// ...
// ...

destroy loo_EmailObj

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

loo_EmailOut = create oleobject
li_rc = loo_EmailOut.ConnectToNewObject("Chilkat.Email")

li_Success = loo_Email.ToForward(loo_EmailOut)
if li_Success = 0 then
    Write-Debug loo_Email.LastErrorText
    destroy loo_Email
    destroy loo_EmailOut
    return
end if



destroy loo_Email
destroy loo_EmailOut