Wrox Programmer Forums
.NET Framework 2.0 For discussion of the Microsoft .NET Framework 2.0.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the .NET Framework 2.0 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
Old October 16th, 2005, 10:56 PM
Authorized User
Join Date: May 2004
Posts: 73
Thanks: 0
Thanked 1 Time in 1 Post
Default Getting handle of the file in use

Hi guys,

I am working a .NET windows application using C#. I have placed a
web browse control in my Windows Form in order to show many types of documents like word doc, text file, ms excel sheet, images or even flash animation etc. There are three panels in this Form. On the left panel there's a Directory tree just like we see in Windows Explorer. The Top panel contains a list of documents in the currently selected directory. I have placed the web browser control in the third panle which is right below the top panel. When the user selects a document (word, excel etc.) it is opened and viewed in the browser control. So far so good. Now the problem occurs when the user selects a document and it is opened for view and he wants to delete it by using the shortcut menu option which is provided by me. The system throws
an exception when i attempt to delete this document from the os directory and says like "The file is in use by another process.". This occurs even if the user selects another document and the application attempts to delete the 'previously' selected document again. This is for sure that the process which is running my app has not yet destroyed the handle of the document, but i don't know how to destory it. I guess the only solution could be P/Invoke but don't know which API functions have to be used. Anybody could help getting rid of this?



Similar Threads
Thread Thread Starter Forum Replies Last Post
Help getting desktop handle Regie General .NET 0 January 23rd, 2006 04:42 PM
How to handle...? chawnu Pro PHP 1 December 8th, 2005 05:14 AM
Handle different text file formats in Biztalk Lavanya Biztalk 1 July 26th, 2004 03:35 AM
Getting value contained by HANDLE panja_swarup C++ Programming 1 December 16th, 2003 10:31 PM
handle a large data file using VB andy_routledge VB How-To 0 August 6th, 2003 12:20 PM

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.