PC Review


Reply
Thread Tools Rate Thread

Closing opened file handles

 
 
Neville Lang
Guest
Posts: n/a
 
      23rd May 2005
Hi all,

I have a .NET CF app that calls some functions in a third party DLL
associated with my app. One of the function calls opens a data file and
keeps it open for the session.

When my app is running, I have provided a feature that enables a user to
move some large data files to a memory card but not the current executing
EXE file - it will remain in RAM. One of the data files is this third party
data file.

I have noticed that after I copy the third party data file to a memory card
in this session of my app, I cannot delete it from its original location due
to its opened file handle. Once this file handle is opened by the third
party app, it is kept open until the end of my app's session, and then it is
closed. My app normally closes if the user taps on the "ok" button - I do
not keep it running.

Is ii possible for me to access and close this file handle within my app so
that I am able to delete the data file from its original location? If so,
how might I go about this.

I must point out that the third party software will continue to operate when
this file handle is closed - the data file is just re-opened later if it has
been closed.

Regards,
Neville Lang


 
Reply With Quote
 
 
 
 
Noah Falk [MSFT]
Guest
Posts: n/a
 
      26th May 2005
Hi,
I'll assume the third party .dll has no API to retrieve the file handle
or close the file programmatically. At the end of the session though how
does it know to close the file? If there is an API that closes down the
session with the 3rd party .dll you might do that and then re-open a new
session once the file has moved. If the .dll closes its file handle upon
being unloaded you might try letting the .dll unload and then reload it
after moving the file. Perhaps one of those options helps?
-Noah Falk, Microsoft .NET CF

 
Reply With Quote
 
Neville Lang
Guest
Posts: n/a
 
      27th May 2005
Noah,

Thank you for your response. I will have a look at those options.

Regards,
Neville Lang



"Noah Falk [MSFT]" <(E-Mail Removed)> wrote in message
news:ro$(E-Mail Removed)...
> Hi,
> I'll assume the third party .dll has no API to retrieve the file handle
> or close the file programmatically. At the end of the session though how
> does it know to close the file? If there is an API that closes down the
> session with the 3rd party .dll you might do that and then re-open a new
> session once the file has moved. If the .dll closes its file handle upon
> being unloaded you might try letting the .dll unload and then reload it
> after moving the file. Perhaps one of those options helps?
> -Noah Falk, Microsoft .NET CF
>



 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to detect closing a file opened by a Process? Henk van Winkoop Microsoft C# .NET 1 25th Apr 2007 05:22 PM
How is the diference about Handles MyBase.Closed and Handles MyBase.Closing marciocamurati Microsoft Dot NET Compact Framework 3 19th Jul 2006 07:46 PM
file handles not closing after files are gone =?Utf-8?B?V2lsbGlhbSBQb3N0?= Windows XP General 0 24th May 2005 08:30 PM
when second file is opened the first auto closing... =?Utf-8?B?SmF6eg==?= Microsoft Word Document Management 0 21st Jan 2004 02:21 PM
Closing File Handles Kangan Microsoft VC .NET 1 6th Jan 2004 11:39 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 04:46 AM.