Loading...

File in use error

Support for GdViewer OCX and GdViewer Pro ActiveX/SDK.

File in use error

Postby GrubyGreg » Sun Feb 15, 2009 7:03 pm

I am developing an application (in MS Access 2007 on VISTA Home Premium), where after viewing scanned images stored in a temporary folder on my desktop (I scan them using HP scanning software) I copy the viewed files to my server and delete the files from the temporary folder. Things work well for one page TIFFs. However when I view multipage TIFFs I cannot delete/move the multipage TIFFs from the temporary folder. I get an error: "File in use". I do issue a command oGdViewer.CloseImage before doing it. After I close the application I can delete the files from the folder manually. It seems that the GdViewer does not release multipage TIFFs from memory. Any suggestions?
Greg
GrubyGreg
 
Posts: 8
Joined: Sun Feb 15, 2009 6:48 pm

Re: File in use error

Postby Loïc » Mon Feb 16, 2009 12:55 pm

Hi,

It seems that the GdViewer does not release multipage TIFFs from memory. Any suggestions?


I've tested the following code without any problem. GdViewer opens a multipage, closes it and the file are deleted.

Code: Select all
Dim f As String

f = "c:\multipage.tif"

GdViewer1.DisplayFromFile (f)
GdViewer1.CloseImage
Kill f



First check you are using the last release, if the problem persists ensure yourself that the file is not handled by another object.

Best regards,

Loïc
Loïc Carrère, support team.
www.orpalis.com
User avatar
Loïc
Site Admin
 
Posts: 4442
Joined: Tue Oct 17, 2006 10:48 pm
Location: France

Re: File in use error

Postby GrubyGreg » Mon Feb 16, 2009 5:23 pm

Still no progress. With the form containing the gdViewer control still open I can't delete the TIFFs manually either (by opening the folder on my desktop and pressing the keybord delete button). I can only delete them after I close the form. I am using the most recent evaluation version of GdPicturePro5.Viewer downloaded yesterday. I also have the GdPicturePro5.Imaging on the same form. Any further thoughts?
Greg
GrubyGreg
 
Posts: 8
Joined: Sun Feb 15, 2009 6:48 pm

Re: File in use error

Postby Loïc » Mon Feb 16, 2009 5:39 pm

Hi Greg,

You probably have an opened file which you didn't closed. I can't see other reason.

If you can reproduce your problem in a short code snippet I will have a look on it.

Best regards,

Loïc
Loïc Carrère, support team.
www.orpalis.com
User avatar
Loïc
Site Admin
 
Posts: 4442
Joined: Tue Oct 17, 2006 10:48 pm
Location: France

Re: File in use error

Postby GrubyGreg » Mon Feb 16, 2009 5:46 pm

That is indeed the problem, but the only program open is Ms Access with the form with gdViewer and gdImaging controls on it. When manually trying to delete the files I get this Windows error:
"The action can't be completed because the file is open in another program. Close the file and try again."
The other program is my program. When I close the form the files delete fine. Is there another way to release the image file from the gdViewer?
Greg
GrubyGreg
 
Posts: 8
Joined: Sun Feb 15, 2009 6:48 pm

Re: File in use error

Postby Loïc » Mon Feb 16, 2009 5:54 pm

Is there another way to release the image file from the gdViewer?


No.

Please, try to reproduce your problem in another code snippet. Doing that you will probably catch the error.

I don't know what you are doing in your code, therefore i can't help you more...

With best regards,

Loîc
Loïc Carrère, support team.
www.orpalis.com
User avatar
Loïc
Site Admin
 
Posts: 4442
Joined: Tue Oct 17, 2006 10:48 pm
Location: France

Re: File in use error

Postby GrubyGreg » Mon Feb 16, 2009 7:12 pm

I attached the app.
1. Place the unzipped "NewScans" folder with it's contents in C:\ (the MS Access file path must be c:\NewScans\ScannerDemo.mdb). The two TIFFs are to be in the same folder (c:\NewScans\)
2. Enable MS access to open the content of C:\NewScans\
3. open the c:\NewScans\ScannerDemo.mdb
4. press the Login button. The frmCreateFilesPro should open
5. On the frmCreateFilesPro form click on one of the listed documents (list box: Documents - middle left of the form)
6. THen click on the TIFF file in the Assigned pages listbox (below the documents listbox). The image should show up on the right hand side of the form.
7. Repeat same for the other Document listed
8. Now click on the "Upload images" button (top middle of the form). It'll ask you if you want to upload files to the server (it'll create a c:\ScannedDocs\ folder and copy the TIFFs there with a different filename). Click yes. The next dialog box will state that 2 of 2 files could not be deleted. There is another message box after that - click OK. WIth the form still open try deleting the TIFFs from the NewScans folder manually - you should not be able to. If you close the frmCreateFilesPro form than you're ok.

The code executing the gdViewer.CloseImage command is attached to the frmCreateFilesPro in the MoveFilesToServer function, which then calls the CopyImageFiles function with the Kill filename statement. The MoveFilesToServer function is called from the cmdClose button (the button's Caption is Upload Images).

Hope you'll be able to reproduce the problem and help me with it. Thanks a lot for your time.
Greg
GrubyGreg
 
Posts: 8
Joined: Sun Feb 15, 2009 6:48 pm

Re: File in use error

Postby GrubyGreg » Sat Feb 21, 2009 2:53 pm

I wondered if you had a chance to look at my problem. I need to move on with the project. Any help is greatly appreciated.
Greg
GrubyGreg
 
Posts: 8
Joined: Sun Feb 15, 2009 6:48 pm

Re: File in use error

Postby Loïc » Tue Feb 24, 2009 4:55 pm

Hi Greg,

There is not attached database into your last post.

I can get a look on a code snippet showing the problem you encountered but I can't take your entire project. This take too many time for us.

If you are able to reproduce the behavior on a tiny project you can send it at esupport (at) gdpicture (dot) com.

Best regards,

Loïc
Loïc Carrère, support team.
www.orpalis.com
User avatar
Loïc
Site Admin
 
Posts: 4442
Joined: Tue Oct 17, 2006 10:48 pm
Location: France


Return to GdViewer [Pro] ActiveX

Who is online

Users browsing this forum: No registered users and 1 guest