Jump to content

Problem with file in use


Gut
 Share

Recommended Posts

I am having a problem with my app. Currently it is shared between multiple people on a single server install. It lists a directories content in a List box and when clicked, it will preview the pdf in an IE control embedded on a GUI. I tried the adobe control, but found it to buggy. Once previewed the use has the option to save the document to another location. The problem is that if someone else is previewing the file also, the file will not move and becomes locked and cannot delete unless I kill the process and delete manually from the directory. Any ideas on how I can check to see if a file is in use before allowing them to preview it?

Link to comment
Share on other sites

You could try _WinAPI_CreateFile and try to open it exclusively first. If that fails then you can assume that your move file function will also fail ...

Link to comment
Share on other sites

I thought about that, but multiple people can view it at the same time, no problem. It just seems to be with the save part. And the weird part is that it doesn't give an error like I thought it would. It just doesn't move. or sometimes it does move, but leaves the original too.

Link to comment
Share on other sites

You could try _WinAPI_CreateFile and try to open it exclusively first. If that fails then you can assume that your move file function will also fail ...

Sorry, I misread your post. I will try that and let you know how I make out.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...