title: OleGraphic.LoadFromStream() Raises OLE Error 800A01E1
body: <p>I have to load a jpeg file into OleGrafic. When I call OleGraphic.LoadFromStream(), it raises OLE Error 800A01E1.</p>
  
  <p>I tried to identify this error, without any success.
  The closest answer related to ole errors was <a href="https://stackoverflow.com/questions/3697849/list-of-all-ole-error-codes">List of all OLE error codes</a> but I can not find 800A01E1 there.</p>
  
  <p>I tried also to initialize Ole in main form. Same form that is generating this error. Without any success.</p>
  
  <pre><code>initialization
    OleInitialize(nil);
  finalization
    oleuninitialize;
  </code></pre>
  
  <p>@ Remy Lebeau: This code worked proper in other projects:</p>
  
  <pre><code>sFileName := OPD.FileName; 
        OleGraphic := TOleGraphic.Create; 
        fs := TFileStream.Create(sFileName, fmOpenRead Or fmSharedenyNone);
       // fs.Seek(0,soFromBeginning);// := 0;  Here I  tried to make sure it's o.
        OleGraphic.LoadFromStream(fs);
        Source := TImage.Create(Nil);
        Source.Picture.Assign(OleGraphic);
        SrcBild := TBitmap.Create; 
        SrcBild.Width := Source.Picture.Width;
        SrcBild.Height := Source.Picture.Height;
        SrcBild.Canvas.Draw(0, 0, Source.Picture.Graphic);
        DstBild := TBitmap.Create;
        DstBild.Width := 200;
        DstBild.Height := 100;
        SmoothResize(SrcBild, DstBild);
  </code></pre>
  
  <p>SmoothResize is from <a href="http://www.swissdelphicenter.com/torry/showcode.php?id=1896" rel="nofollow noreferrer">http://www.swissdelphicenter.com/torry/showcode.php?id=1896</a></p>