Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

File previlages for the current logged user

Posted on 2004-09-14
2
Medium Priority
?
209 Views
Last Modified: 2013-11-20
I have created a database file in Administrator mode  under windows XP operating system  using vc++ application. When I login as a Guest and try to open the same file using my VC++ application it fails.
Please suggest me how do I know the current user permission for a file using MFC coding .
0
Comment
Question by:shrinivasbk
  • 2
2 Comments
 
LVL 13

Accepted Solution

by:
SteH earned 200 total points
ID: 12052710
Do you want to read the exact file permissions or do you just want to know if privileges unable the current user to open that file?
For latter you can supply a CFileException as last parameter in CFile::Open. In case of a failure to open this exception var will be filled and you can check its m_cause member. If it equals CFileException::accessDenied you don't have enough priviliges.

If you want the full access priviliges of that file you need to run a program as administrator and check/read its permissions. This only makes little sense in the context you asked so I don't go into detail here.
0
 
LVL 13

Expert Comment

by:SteH
ID: 12062645
Hi shrinivasbk,

it would be nice to get a second chance before receiving a grade of C. You question was not very detailed so a detailed answer could not be expected in the first go. Experts are willing to give more detailed anwers if needed but you need to allow tem to.

You might want to read the help on grading at
http://www.experts-exchange.com/help.jsp#hi73
<snip>
# C: Because Experts' reliability are often judged by their grading records, many Experts would like the opportunity to clarify if you have questions about their solutions. If you have given the Expert(s) ample time to respond to your clarification posts and you have responded to each of their posts providing requested information; or if the answers, after clarification, lack finality or do not completely address the issue presented, then a "C" grade is an option. You also have the option here of just asking Community Support to delete the question.
<snip>

0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

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…
In this article, I'll describe -- and show pictures of -- some of the significant additions that have been made available to programmers in the MFC Feature Pack for Visual C++ 2008.  These same feature are in the MFC libraries that come with Visual …
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.
Are you ready to place your question in front of subject-matter experts for more timely responses? With the release of Priority Question, Premium Members, Team Accounts and Qualified Experts can now identify the emergent level of their issue, signal…
Suggested Courses
Course of the Month7 days, 16 hours left to enroll

824 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