Delphi ActiveX
Delphi ActiveX
Transition from Imap.ListSubscribed to Imap.MbxList
Provides instructions for replacing deprecated ListSubscribed method calls with MbxList.Chilkat Delphi ActiveX Downloads
uses
Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics,
Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Vcl.StdCtrls, Chilkat_TLB;
...
procedure TForm1.Button1Click(Sender: TObject);
var
success: Integer;
imap: TChilkatImap;
reference: WideString;
mbxPattern: WideString;
mboxesObj: IMailboxes;
subscribed: Integer;
mboxes: TMailboxes;
begin
success := 0;
imap := TChilkatImap.Create(Self);
// ...
// ...
reference := '';
mbxPattern := '*';
// ------------------------------------------------------------------------
// The ListSubscribed method is deprecated:
// Lists only subscribed mailboxes.
mboxesObj := imap.ListSubscribed(reference,mbxPattern);
if (imap.LastMethodSuccess = 0) then
begin
Memo1.Lines.Add(imap.LastErrorText);
Exit;
end;
// ...
// ...
// ------------------------------------------------------------------------
// Do the equivalent using MbxList.
// Your application creates a new, empty Mailboxes object which is passed
// in the last argument and filled upon success.
// Lists only subscribed mailboxes.
subscribed := 1;
mboxes := TMailboxes.Create(Self);
success := imap.MbxList(subscribed,reference,mbxPattern,mboxes.ControlInterface);
if (success = 0) then
begin
Memo1.Lines.Add(imap.LastErrorText);
Exit;
end;
end;