• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 573
  • Last Modified:

Errorcodes if Open files


Hi,

I need to indicate to user that files are open (eg: MSoutlook.exe is running therefore PST's are open). Can I safely assume that I can trap $20 and $33 or could there be more errorcodes ?

1)
  { The process cannot access the file because it is being used by another process. }
  ERROR_SHARING_VIOLATION = $20;
  {$EXTERNALSYM ERROR_SHARING_VIOLATION}
2)
  { The process cannot access the file because }
  { another process has locked a portion of the file. }
  ERROR_LOCK_VIOLATION = 33;
  {$EXTERNALSYM ERROR_LOCK_VIOLATION}

Regards
Allan
0
Allan_Fernandes
Asked:
Allan_Fernandes
  • 2
1 Solution
 
systanCommented:
use
try except for error trapping
including there Raising exceptions

http://www.delphibasics.co.uk/Article.asp?Name=Exceptions
0
 
Allan_FernandesAuthor Commented:
Hi,

My application cannot disturb the user except on 'Open Error'. For other errors I have to fill a log and continue silently.

Regards
Allan
0
 
Allan_FernandesAuthor Commented:
I will use $20 and $33 as of now
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Cloud Class® Course: Microsoft Office 2010

This course will introduce you to the interfaces and features of Microsoft Office 2010 Word, Excel, PowerPoint, Outlook, and Access. You will learn about the features that are shared between all products in the Office suite, as well as the new features that are product specific.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now