Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

mysterious sharingViolation using a CStdioFile

Posted on 2002-04-19
9
Medium Priority
?
588 Views
Last Modified: 2013-11-20
My app writes several ascii files (I use CStdioFile) and
generally things work fine.  But I have intermittent
mysterious problems where things fail, and the CFileException that comes back has "sharingViolation" in
its "m_cause" member.

Looking at some doc for this it says:

"SHARE.EXE was not loaded, or a shared region was locked"

Now my file is a simple file on the local disk, not in
a shared folder or having anything to do with sharing as
far as I can tell.  I'm on XP (haven't seen it on other
computers, but who knows...)

Do you get a sharingViolation is the file is still open
from a previous action?  But I think I always close the
file, so I don't get what the problem can be.

Any ideas?
0
Comment
Question by:tullhead
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
9 Comments
 

Author Comment

by:tullhead
ID: 6955483
Oh yeah -- what is this "SHARE.EXE" that the documentation
mentions??
0
 
LVL 3

Expert Comment

by:job_s
ID: 6955825
Are U sure U r closing the file after operation?
Be sure that.Problem because of someone opens that file.

Or try |CFile::shareDenyNone flag




0
 

Expert Comment

by:muneeb_baig
ID: 6957407
Please use CFile::shareDenyNone in Open method.  
0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
LVL 49

Expert Comment

by:DanRollins
ID: 6964836
hi muneeb_baig,
Please don't post Answers.  The experts in this Topic area have agreed to post Comments so that the asker can get more, and more varied responses from the Experts.

So in the future, please post comments like everyone else.  Thanks!

-- Dan
0
 
LVL 6

Expert Comment

by:snoegler
ID: 6977711
Are you using Norton AV (or any other online scanner)?
0
 

Author Comment

by:tullhead
ID: 6977870
I've got Norton AV there, I believe...
could that be related?

Actually, on that same computer I also have occaisional
glitches where it says it can't open a file (in genreal
problems with file access) -- this occurs even from apps
like the visusal studio editor -- then, a second later
all if fine.

Hmmm....
0
 
LVL 6

Accepted Solution

by:
snoegler earned 800 total points
ID: 6977907
Yup, this is caused by NAV (NAV recognizes that a file gets modified and tries to grasp & check the file before you do). Disable NAV's online scanning and the problems will be gone (there was already a similar thread here).
0
 

Author Comment

by:tullhead
ID: 6978150
Thanks snoegler -- you get the points
0
 
LVL 6

Expert Comment

by:snoegler
ID: 6978229
Thx
0

Featured Post

Will your db performance match your db growth?

In Percona’s white paper “Performance at Scale: Keeping Your Database on Its Toes,” we take a high-level approach to what you need to think about when planning for database scalability.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction: The undo support, implementing a stack. Continuing from the eigth article about sudoku.   We need a mechanism to keep track of the digits entered so as to implement an undo mechanism.  This should be a ‘Last In First Out’ collec…
If you use Adobe Reader X it is possible you can't open OLE PDF documents in the standard. The reason is the 'save box mode' in adobe reader X. Many people think the protected Mode of adobe reader x is only to stop the write access. But this fe…
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
How to fix incompatible JVM issue while installing Eclipse While installing Eclipse in windows, got one error like above and unable to proceed with the installation. This video describes how to successfully install Eclipse. How to solve incompa…

670 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question