|
Hi there!!!
On my system, there is a folder which can be accessed by a specific user(e.g. auser) of my computer. Administrator group has full access rights on that folder too. The problem is I need to validate the access rights of "auser" on that folder through programming. but dont know the specific API to do that. following API can do it, but still not sure:
GetNamedSecurityInfo(...)
GetTokenInformation(...)
Using GetNamedSecurityInfo(...) API, I can get the DACL of that folder. But how can I determine which user has waht access rights on that folder????
Would appreciate any advice as how to go abt it or any code snippet.
Thanks in advance.
RM.
|
|
|
|
|
try using _access(...)
if (_access("\\\\myserver\\myfolder\\", 6) == 0)
{
}
0 Existence only
2 Write permission
4 Read permission
6 Read and write permission
|
|
|
|
|
Thanks for replying. but unfortunately it only validates a specific rights on a file or a directory, contrary to what I am looking for
If I can translate my problem in an statement, it would something like this:
"Check 'auser' has read rights on directory(myfolder)????"
where 'auser' is a local user on a computer.
RM.
|
|
|
|
|
i use CString to much i think, i've seen many people uses LPCSTR
am i losing much by using CString?
|
|
|
|
|
I don't think there's a huge performance loss when using CString; internally, it must be similar to using LPCSTR ( char* )é
For day to day operation, just the simpler usage of CString ( or std::string ) makes it up for the programmer at least.
Maximilien Lincourt
Your Head A Splode - Strong Bad
|
|
|
|
|
it depends on how you use it!
CString is realy OK, the only thing
you should do is, if you pass a CString
as a parameter, pass it as const CString&
and dont an a lot of small datachungs
to a CString in a loop
int n=0;
CString dummy;
while(n<10000) {
dummy+=(char)((n%30)+30);
++n;
}
|
|
|
|
|
I have an SDI application. The title bar text is:
FileName - AppName
My question is: how can I change AppName on the fly? I have a menu item to swtich between two options. I want the application title bar to reflect which option is currently selected. So I want the title bar text to be something as:
FileName - AppName option1
or
FileName - AppName option2
I searched MSDN, and found there is a function AfxGetAppName( ), but it is to get CWinApp.m_pszAppName. Is there a function to set the m_pszAppName?
Thank you very much for any hint.
|
|
|
|
|
Try SetWindowText()
Artificial intelligence is no match for natural
stupidity.
|
|
|
|
|
Get it. CMainFrame.SetWindowText().
Thanks a lot!
|
|
|
|
|
AfxGetModuleState()->m_lpszCurrentAppName = L"title"
|
|
|
|
|
hello,
is there anyone that can help me :
how to send at command to modem (dial-up modem) through serial communication?
i've tried with some serial communication program, but it can't work.
|
|
|
|
|
mark182 wrote:
how to send at command to modem (dial-up modem) through serial communication?
So there are two major activities in your project.
1) Workiing with Serial Ports
2) Working with Modems
Which one do you want or need help with?
You might get more response to smaller more specific questions.
mark182 wrote:
but it can't work.
You must provide more specific information than that in order for someone to determine how to help.
"No matter where you go, there your are." - Buckaroo Banzai
-pete
|
|
|
|
|
Ok, In my project now, i'm working with serial port.
i've serial chat programming, and i try to send at command to modem.
That's i mean "....it can't work".
Actually, my project is working with modem, and now i'm trying to send
at command, can anyone can help me?, Or maybe palbano, if you know,
why don't you help me.
I've tried with VCTERM from msdn, but i don't understand on it.Beside that i don't understand making a program with activex. So, i try with serial programming like chat program with serial because it can send character.
|
|
|
|
|
Hi, I want to pre-configure the state of the a CFileDialog (dialog) I use. What I want is the view to be set to "view Large Icons" or thumbnails.
Also, in another question, can I use the "Search (results) dialog" like a CFileDialog. My use would be a file/folder browse dialog that shows all possible files that match a certain file extension (.BMP,.JPG,.ICO) all under a common root folder.
Thanks!
Regards,
Johnny
(Yes, at times CP server is slow, but the wealth of resource info and the number of users is understandable.)
|
|
|
|
|
|
john john mackey wrote:
What I want is the view to be set to "view Large Icons" or thumbnails.
Defaulting to large icons is easy enough using both CFileDialog and GetOpenFileName() . However, I've not been able to default to thumbnails using CFileDialog , only GetOpenFileName() .
"When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen
|
|
|
|
|
Hi All,
MY application is causing an assert in the line 249 of viewcore.cpp.This is a OnMouseActivate() function and the assertion is at
ASSERT(pParentFrame == pDesktopWnd || pDesktopWnd->IsChild(pParentFrame));
can someone tell me what might be the possible condition.This is a randomly occuring bug and i dont have any logs regarding this
Thanks in advance
Regards
Raghu
|
|
|
|
|
Raghunandan S wrote:
can someone tell me what might be the possible condition.
Either the parent frame is the desktop or the parent frame is a direct descendent of the desktop. Put a breakpoint on that line to see which of the two conditions is evaluating to FALSE .
"When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen
|
|
|
|
|
Hi Raghunandan,
Did you subclass a view? It sounds like you are using a view where you should have a window. For example, CListCtrl is derived from CWnd but CListView is derived from CView.
Jeff
|
|
|
|
|
Hi,
Mine is an SDI application where I do like this:
CSingleDocTemplate* pDocTemplate;
pDocTemplate = new CSingleDocTemplate(
IDR_MAINFRAME,
RUNTIME_CLASS(CConvertDoc),
RUNTIME_CLASS(CMainFrame),
RUNTIME_CLASS(CConvertView));
AddDocTemplate(pDocTemplate);
in my initinstance
CMainFrame is derived from CFrameWnd and CConvertView is derived from CEditView.
Is there any problme in this kind of creation?
Regards
Raghu
|
|
|
|
|
hi,
i am creating voice chat project. It works in LAN very well,but it works in WAN(internet)echo proplem and the voice is not clear.how i reduce the problem .
in my project, the voice are not stored in file.it stored in char rray,then send to server.
plz give any idea and sample compression program.
Thank you.
|
|
|
|
|
when I made a dialog based project(MFC) ,I didn't add "Context Sensitive Help" to it. Now I want to add "Help".Is it possible ?
|
|
|
|
|
I just asked the same question a few days ago. The best thing I was told was to create a new project, add help to it, then see what's different.
If it's broken, I probably did it
bdiamond
|
|
|
|
|
Hi,
My program uses 'GetspecialfolderPath(CSIDL_PERSONAL)' to retreive the my documents folder, and saves a file in the folder using CStdioFile.
On Win2000 this my-docs folder path is returned as an UNC path like '\\server\\..$\my documents\...'
Here, CStdioFile fails to create the file. I guess it is due to UNC name. How can I convert this to the mapped drive ?
or is there any workaround ?
Please help, thanks in advance to all.
regards
hari
Hari Krishnan
|
|
|
|
|
Hi all,
1.I have two activeX control FullControl and Composite Control.
2.In composite control I have two push button.
3.I have added two events in the composite control. say ClickOne and Clicktwo.
4.Also implemented Message Handlers for composite control say Onbutton1.and Onbutton2
5.Now I am calling event functions clickone in one of the message hanler(Onbutton1/Onbutton2)
How I can catch the events ClickOne which are fired when one of the button are pressed in my Full control.
I know it can be done using connection point and sinking events. but don't know how.
Can someone help me.
Thanks in advance,
Abhishake
Thanks
Abhi Lahare
|
|
|
|