Solved

mysterious sharingViolation using a CStdioFile

Posted on 2002-04-19
9
587 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 200 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

Moving data to the cloud? Find out if you’re ready

Before moving to the cloud, it is important to carefully define your db needs, plan for the migration & understand prod. environment. This wp explains how to define what you need from a cloud provider, plan for the migration & what putting a cloud solution into practice entails.

Question has a verified solution.

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

Here is how to use MFC's automatic Radio Button handling in your dialog boxes and forms.  Beginner programmers usually start with a OnClick handler for each radio button and that's just not the right way to go.  MFC has a very cool system for handli…
Introduction: Ownerdraw of the grid button.  A singleton class implentation and usage. Continuing from the fifth article about sudoku.   Open the project in visual studio. Go to the class view – CGridButton should be visible as a class.  R…
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.
Monitoring a network: why having a policy is the best policy? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the enormous benefits of having a policy-based approach when monitoring medium and large networks. Software utilized in this v…

630 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