Re: RSObjectTypeNotSupported with TidPOP3.RetrieveRaw

Giganews Newsgroups
Subject: Re: RSObjectTypeNotSupported with TidPOP3.RetrieveRaw
Posted by:  Remy Lebeau (TeamB) (gambit47.no.spam@no.spam.yahoo.com)
Date: Mon, 15 Mar 2004

"Sylvainlefou" <s_vir…@hotmail.com> wrote in message
news:F65D3862A595E240s_vir…@hotmail.com...

>    MsgTs: Tstrings;

You are declaring a TStrings, but you are never actually instantiating it.
Thus you are passing an invalid object to RetreiveRaw().  Use the following
code instead:

    procedure TForm1.Button1Click(Sender: TObject);
    var
        NbMessages: Integer;
        idMess: Integer;
        MsgTs: Tstrings;
    begin
        MsgTs := TStringList.Create;
        try
            idpop31.Connect;
            try
                NbMessages := idpop31.CheckMessages;
                for idMess:=1 to NbMessages do
                begin
                    idpop31.RetrieveRaw(idMess, MsgTs);
                    memo1.lines := MsgTs;
                end;
            finally;
                idpop31.Disconnect;
            end;
        finally
            MsgTs.Free;
        end;
    end;

Gambit

Replies

None

In response to

RSObjectTypeNotSupported with TidPOP3.RetrieveRaw posted by Sylvainlefou on Mon, 15 Mar 2004