Solved

File previlages for the current logged user

Posted on 2004-09-14
2
199 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 100 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

Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

Join & Write a Comment

Introduction: Displaying information on the statusbar.   Continuing from the third article about sudoku.   Open the project in visual studio. Status bar – let’s display the timestamp there.  We need to get the timestamp from the document s…
Introduction: Finishing the grid – keyboard support for arrow keys to manoeuvre, entering the numbers.  The PreTranslateMessage function is to be used to intercept and respond to keyboard events. Continuing from the fourth article about sudoku. …
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.
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…

708 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

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now