Re: Access violation in TJPEGImage on W2K and XP



On 16 Sep 2005 01:20:25 -0700, "jodleren" <sonnich@xxxxxx> wrote:

>The dormat and stuff are new, the original code was:
>
> if (LowerCase(ExtractFileExt(sFilename)) = '.jpg') or
> (LowerCase(ExtractFileExt(sFilename)) = '.jpeg') then
> begin
> { delete old bitmapfile }
> DeleteFile(PChar(WindowsDir + sWinImgFile));
> { converts the image }
> try
> BitmapImage := TBitmap.Create;
> JPEGImage := TJPEGImage.Create;
> if FileExists(sFilename) then
> JPEGImage.LoadFromFile(sFilename)
> else
> JPEGImage.LoadFromFile(WindowsDir + sFilename);
> BitmapImage.Assign(JPEGImage);
> BitmapImage.SaveToFile(WindowsDir + sWinImgFile);
> BitmapImage.Free;
> JPEGImage.Free;
> except
> BitmapImage.Free;
> JPEGImage.Free;
> end;
> end;
>
>
>I agree that the finally should be better, but that is really not the
>problem, nor Dormat or those.
>I have played with this for some time, and by removing the Assign it
>does no longer give the access violation.
>
>The code is so simple, yes, it should work.
>But it does not explain the access violation when closing the app.

>That is my main point.

Most likely there is something else wrong in your App which only shows
up if you do not do the Assign
.



Relevant Pages

  • Re: Access violation in TJPEGImage on W2K and XP
    ... The dormat and stuff are new, the original code was: ... DeleteFile(PChar(WindowsDir + sWinImgFile)); ... But it does not explain the access violation when closing the app. ...
    (comp.lang.pascal.delphi.misc)
  • Re: IE6 onlick not firing
    ... the onclick event does not fire. ... Our app is targeted at IE6+. ... On one machine the original code works for some users and not for ... without even the implied warranty of merchantability ...
    (microsoft.public.scripting.jscript)
  • Re: IE6 onlick not firing
    ... the onclick event does not fire. ... Our app is targeted at IE6+. ... On one machine the original code works for some users and not for ... > p.s. apols for the cross post - had to post again for managed support ...
    (microsoft.public.scripting.jscript)