VoyForums
[ Show ]
Support VoyForums
[ Shrink ]
VoyForums Announcement: Programming and providing support for this service has been a labor of love since 1997. We are one of the few services online who values our users' privacy, and have never sold your information. We have even fought hard to defend your privacy in legal cases; however, we've done it with almost no financial support -- paying out of pocket to continue providing the service. Due to the issues imposed on us by advertisers, we also stopped hosting most ads on the forums many years ago. We hope you appreciate our efforts.

Show your support by donating any amount. (Note: We are still technically a for-profit company, so your contribution is not tax-deductible.) PayPal Acct: Feedback:

Donate to VoyForums (PayPal):

Login ] [ Contact Forum Admin ] [ Main index ] [ Post a new message ] [ Search | Check update time | Archives: 123456789[10] ]


[ Next Thread | Previous Thread | Next Message | Previous Message ]

Date Posted: 07:13:19 03/30/00 Thu
Author: Michel
Subject: Re: Access violation after 30 or little more pictures
In reply to: yuriy 's message, "Re: Access violation after 30 or little more pictures" on 08:56:39 03/29/00 Wed


Hi Yuriy,

I'm really not sure what the problem is.

CreateDibSection is a Windows API call, so I'm confused as to what causes the problem.

You may want to try a different scanning approach. What I have not quite figured out is, why do you call ScanMenuClick in a loop. If you want to scan multiple images, this is handled automatically if using a sheet feeder. This is what the demo program does. I assume you are using a sheet feeder. You may want to try it with the Demo program unmodified in multipage scanning. Also, sometimes there are problems when running a program that scans from within the IDE; try running the program independently from the IDE.

Best regards,

Michel

> Hi Michel
>
> As I wrote I tested this code twise and got exeption
> after 27 and 32 scaning!!!!
>
> Yuriy
>
>
> > Hi Yuriy,
> >
> > With the code changes, do you still get the
> exception?
> >
> > Best regards,
> >
> > Michel
> >
> > > Hi Michel
> > > Thank you for the fast answer!
> > >
> > > I changed code, as you recomended. You were correct
> > > because now it works much slower but it was raised
> > > after 27 or 32 times of scaning.
> > >
> > > The new code is here:
> > > procedure TMainForm.Button1Click(Sender: TObject);
> > > var
> > > i, i1: Integer;
> > > begin
> > > i1:=0;
> > > try
> > > for i:= 1 to 50 do begin
> > > while Fdelay do
> > > Sleep(1000);
> > > Fdelay := True;
> > > ScanMenuClick(Sender);
> > > Label3.Caption := inttoStr(i);
> > > i1 := i;
> > > Application.ProcessMessages;
> > > Sleep(10000);
> > > end;
> > > except
> > > Label3.Caption := 'Raising after
> '+inttoStr(i1);
> > > end;
> > > end;
> > >
> > > In the FormCreate I set FDelay as True and in the
> end
> > > of OnAcquire I set it as False.
> > >
> > > Regards
> > > Yuriy
> > >
> > > >
> > > > Hi Yuriy,
> > > >
> > > > From what I can see in the code example, is it
> > > > possible that you are calling ScanMenuClick
> before
> > > the
> > > > image is finished scanning? You should only call
> > > > ScanMenuClick again once the TScanner.OnAcquire
> > event
> > > > has been triggered. With this kind of code
> > structure
> > > > you would need a boolean flag that you would need
> > to
> > > > be set in the OnAcquire event.
> > > >
> > > > Best regards,
> > > >
> > > > Michel
> > > >
> > > > > > In our application scaning blows up after
> > scaning
> > > > > some
> > > > > > pictures. I tested it by adding button for
> loop
> > > > > > scanning.
> > > > > >
> > > > > > After that I moved this code to your demo
> form
> > > and
> > > > I
> > > > > > got the same result. In ScanMenuClick I
> > commented
> > > > > > calling CheckDirty because it requires using
> > > > Dialog.
> > > > > >
> > > > > > procedure TMainForm.Button1Click(Sender:
> > > TObject);
> > > > > > var
> > > > > > i, i1: Integer;
> > > > > > begin
> > > > > > i1:=0;
> > > > > > try
> > > > > > for i:= 1 to 50 do begin
> > > > > > ScanMenuClick(Sender);
> > > > > > Label3.Caption := inttoStr(i);
> > > > > > i1 := i;
> > > > > > Application.ProcessMessages;
> > > > > > Sleep(10000);
> > > > > > end;
> > > > > > except
> > > > > > Label3.Caption := 'Raising after
> > > > '+inttoStr(i1);
> > > > > > end;
> > > > > > end;
> > > > > >
> > > > > > The program blows up in the file EnDiGraph in
> > > line
> > > > > 732:
> > > > > >
> > > > > > FBitmapHandle := CreateDibSection( FDC,
> > > > > >
> > > > > > Windows.PBitmapInfo(@FBitmapInfo)^,
> > > > > >
> > > DIB_RGB_COLORS,
> > > > > >
> > > Pointer(FBits),
> > > > > > 0, 0);
> > > > > >
> > > > > >
> > > > > > Best Regards
> > > > > > Yuriy Gendin
> > > > >
> > > > > P.S. As addition
> > > > >
> > > > > Compiler - Delphi 4, Scanner - HP Scanjet
> 5200C.
> > > > > I prefer to use ShouUI=False for many reasons,
> > for
> > > > > example program interface is not English.
> > > > >
> > > > > Yuriy

[ Next Thread | Previous Thread | Next Message | Previous Message ]

[ Contact Forum Admin ]


Forum timezone: GMT-5
VF Version: 3.00b, ConfDB:
Before posting please read our privacy policy.
VoyForums(tm) is a Free Service from Voyager Info-Systems.
Copyright © 1998-2019 Voyager Info-Systems. All Rights Reserved.