Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Windows Forms / WinForm General / September 2004

Tip: Looking for answers? Try searching our database.

File is used in another process

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Kashif Javed - 10 Sep 2004 17:14 GMT
Hi there

My small OCR program is written in VB .NET. The main procedure uses the
FSO and scans a folder for image files and then send each file name to a
Function which does  the OCR using MODI and extracts the text out of
that image file and returns the extracted text to the main procedure.
After extracting the text out of that image file the program tries to
delete the file but it gives an error message "File is being used in
another Process".
The VB 6 version of the program is working fine.
Any suggestions or help will be appreciated?
Thank you

Kashif
Christopher Kimbell - 12 Sep 2004 16:06 GMT
With FSO I assume you mean FileSystemObject. In the .NET version I would
recomend you use the native .NET IO classes, instead of the COM objects.

How do you delete the file? Do you delete using a reference or a filename?
If you delete it using the filename, there might still be a reference active
to the file.
VB 6 and VB.NET have different garbage collection systems, objects may hang
around longer in the .NET version before they are collected. I think VB 6
uses a reference counting system. The VB 6 version might release the object
faster than the .NET version.

File handles are a limited resource, you should always explicitly release
them.

Chris

> Hi there
>
[quoted text clipped - 10 lines]
>
> Kashif

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.