Loading ...
Sorry, an error occurred while loading the content.

Re: Loading decoded - still access violation

Expand Messages
  • aithai
    Hi Marcello, I still get access violation when I try to load(Click the button). Now I have only two lines. The images are available in the lbFiles.Listbox:
    Message 1 of 3 , Apr 14, 2003
    • 0 Attachment
      Hi Marcello,
      I still get access violation when I try to load(Click the button).
      Now I have only two lines. The images are available in the
      lbFiles.Listbox:
      ============================================
      procedure TForm1.Button1Click(Sender: TObject);
      begin

      Msg.AttachList[0].Decode;

      Image2.Picture.Graphic.LoadFromStream(Msg.AttachList[0].Decoded);

      end;
      ===================================
      Can you try it out and see what is wrong? I just use your demo, and
      put a timage and button.

      Thanks for you kindness.

      Regards.




      --- In tmail2000@yahoogroups.com, Marcello <mycelo@y...> wrote:
      > Hi Aithai,
      >
      > I think you must type the following line before saving the file:
      >
      > Msg.AttachList[lbFiles.ItemIndex].Decode;
      >
      > This will initialize the "Decoded" stream.
      > Then you can simply do the following:
      >
      > Image2.Picture.Graphic.LoadFromStream(Msg.AttachList
      [lbFiles.ItemIndex].Decode);
      >
      > Since you don't need to have a temporary stream.
      > Regards,
      >
      > --- aithai <aithai@y...> wrote:
      > > Hi,
      > > I have loaded an EML with bmp images into the Mail2000 Demo.
      > > I add an extra button and a TImage.
      > >
      > > I try to load the decoded images into a memory stream and then
      use
      > > the Timage.picture.graphic.LoadfromFile to load the decoded
      stream
      > > into it. BUT UPON LOADING, IT ALWAYS GIVE ERROR AND CRASHED. Can
      > > someont please point out what is wrong with the codes.
      > > The codes are as follows:
      > > ====================================================
      > > procedure TForm1.Button1Click(Sender: TObject);
      > > var x:integer; M1:TMemoryStream;
      > > begin
      > >
      > > try
      > > x:= lbFiles.ItemIndex;
      > >
      > > Msg.AttachList[lbFiles.ItemIndex].Decoded.SaveToStream(M1);{save
      > > decoded to stream}
      > >
      > > Image2.Picture.Graphic.LoadFromStream(M1);{save pix to Timage}
      > > M1.Free;
      > >
      > > finally
      > >
      > > end;
      > >
      > > end;
      > >
      > >
      >
      >
      > =====
      > Marcello Tavares
      > mycelo@y...
      > ICQ 5831833
      > Sorocaba/SP BRAZIL
      >
      > __________________________________________________
      > Do you Yahoo!?
      > Yahoo! Tax Center - File online, calculators, forms, and more
      > http://tax.yahoo.com
    Your message has been successfully submitted and would be delivered to recipients shortly.