View Single Post
  #3 (permalink)  
Old October 13th, 2005, 03:04 AM
baburman baburman is offline
Authorized User
Points: 382, Level: 6
Points: 382, Level: 6 Points: 382, Level: 6 Points: 382, Level: 6
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
Join Date: May 2004
Location: Rawalpindi, -, Pakistan.
Posts: 73
Thanks: 0
Thanked 1 Time in 1 Post

Sorry for the late reply, i was busy in some other tasks and in the meantime i have also been trying to get solution from Win32 APIs. Let me explain it in some details. 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 opens 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 in order to delete the file.

Reply With Quote