|
inner wrote:
On the other hand if I have like 158 privs. - that's a lot of groups.
Yes. But do you really have 158 privs?
Tomasz Sowinski -- http://www.shooltz.com ** If you're going to rape, pillage and burn, be sure to do things in that order. **
|
|
|
|
|
if you relay on NT authentication just call GetUserName and assign privileges according the output..
|
|
|
|
|
I can get user name, but how do I know what this user is allowed to do in my app and what not?
|
|
|
|
|
I am trying to use the shell commands to put a shortcut on my desktop. I want this to work for Nt and ... for all users. How would I do this? NT and Win98 for example has different places and also it is possible that it is not C: but D: directory. Is there an easy way?
I need a "C://..." or whatever to state where this desktop directory is.
THanks.
|
|
|
|
|
char szDesktopPath[MAX_PATH]="";
if(!CoInitialize(0)){
LPMALLOC pMalloc;
if(SUCCEEDED(SHGetMalloc(&pMalloc))){
LPITEMIDLIST pidl;
if(SUCCEEDED(SHGetSpecialFolderLocation(NULL,CSIDL_DESKTOP,&pidl))){
SHGetPathFromIDList(pidl,szDesktopPath);
pMalloc->Free(pidl);
}
pMalloc->Release();
}
CoUninitialize();
}
Admittedly, a little convoluted
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
Check the following files "test.h" and "test.cpp".
When using the following code, Class View does not identify the constructor correctly,
and displays it as Global() and not as test().
If Global is defined in the same file ( test.cpp ), the bug does not occur.
Does anybody know of a solution to this bug?
test.h
-----
#define Global __declspec(dllexport )
test.cpp
------
#include "test.h"
class test {
Global test();
};
Shai Gutner
shai.gutner@schema.com
|
|
|
|
|
I built a WebService in C# and consumed it in VC. All works on the machine with VS.Net, but fails on the client machine after the install. I have included both msvcr70.dll and mfc70.dll with the install. Any suggestions as to what I'm missing?
|
|
|
|
|
I have an SDI application. When WM_CLOSE message is received by CMainFrame, I want to check a flag bSthInProcess. I want the application to exit only when this flag is clear. So I coded
LRESULT CMainFrame::WindowProc(UINT message, WPARAM wParam, LPARAM lParam)
{
if ( message == WM_CLOSE )
{
CMyView *pView = (CMyView *)(GetActiveView());
if (pView->bSthInProcess)
MessageBox("wait while exiting.. ");
while ( pView->bSthInProcess )
Sleep(2);
}
return CFrameWnd::WindowProc(message, wParam, lParam);
}
the problem is, if I use MessageBox(), use have to click on the OK button. I want a message which will display the message, and close itself when the application closes.
How could I code it?
Thank you very much!
|
|
|
|
|
You may want to use a modeless, custom dialog box.
Michel
If I am wrong or said something stupid, I apologize in advance
|
|
|
|
|
Thank you, this works.
but, is there any easier way to do it? I mean, is there any API funciton like MessageBox()?
|
|
|
|
|
You will have to do a custom modeless dialog box because MessageBox is a modal dialog box function. There are no other quick APIs to creating a message box.
|
|
|
|
|
okay then. Sorry for my laziness. hmm, shouldn't MFC provide a function doing this?
Thank you for your advice!
|
|
|
|
|
Lucy
Do this. Create a thread. Show the messagebox from that thread. Just after you start this thread, Sleep() for a while, then continue. Thus when the main thread exits the second thread is closed.
Nish
I am looking for a free racing game. Old style racing game without any complicated 3D stuff. Around 4 MB download. If anyone has such a game, please inform me.
|
|
|
|
|
Hi Nish,
I believe your method works. But it is not any easier to implement in terms of lines of code economy. Hmm, on second thought, I don't need to create a dialog class for this. That's the advantage. Thank you!
|
|
|
|
|
lucy wrote:
Hmm, on second thought, I don't need to create a dialog class for this.
Exactly. Good girl!!
Nish
I am looking for a free racing game. Old style racing game without any complicated 3D stuff. Around 4 MB download. If anyone has such a game, please inform me.
|
|
|
|
|
Hi,
When I compile and ActiveX object using ATL, I can see the "Performing Registration" friendly message in the Build View.
My question is.. what operations does it performs ? Only RegSvr32 ? or RegTLib or... ?
Thanks, Bye !
Braulio
|
|
|
|
|
Hola Braulio!
Go to Project -> Settings -> Custom build tag. The commands executed after building the object are:
regsvr32 /s /c "$(TargetPath)"
echo regsvr32 exec. time > "$(OutDir)\regsvr32.trg" which executes rgsvr32.exe and times the operation. It could be that the commands are different for the particular project configuration you selected, but now you know where to look
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
Hola Joaquin !
I looked at that, I was very confused because, I can make work my ActiveX COM Object if I compile the source code in the same machine ( if not then it will fail to pass the metafile for the thing of handling my activeX inside a word automated instance in my MFC app), I thought maybe I forget to register the TLB or ... no idea
I don´t know what to do..., The only ideas that I have is to Marshal the interface ( now what I make is to have an Stream in HGlobal that should be enough), or try to get the metafile buffer and paste it in an safe array or as CData in an XML Dom tree).
What do you think ?
Braulio
|
|
|
|
|
Ummm... If you go to Project -> Settings, select your .idl and then the Custom Build tag, you can see the command midl is invoked.
midl /Oicf /h "test.h" /iid "test_i.c" "test.idl" I hope this makes some sense to you (I'm no expert in ATL COM stuff).
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
Many of us work for Corporations that have central servers. This NT\2K servers each have a list of available users that are allowed to connect to the server. Is there anyway to Query the server and get the entire list of users? Also, Is there any way to query each network computer and see what user is logged on?
Nothing is impossible, It's merely a question of figuring out HOW?
|
|
|
|
|
NET_API_STATUS NetUserEnum(
LPCWSTR servername,
DWORD level,
DWORD filter,
LPBYTE *bufptr,
DWORD prefmaxlen,
LPDWORD entriesread,
LPDWORD totalentries,
LPDWORD resume_handle
);
NET_API_STATUS NetWkstaUserEnum(
LPWSTR servername,
DWORD level,
LPBYTE *bufptr,
DWORD prefmaxlen,
LPDWORD entriesread,
LPDWORD totalentries,
LPDWORD resumehandle
);
check http://www.mvps.org/win32/
|
|
|
|
|
Thank you much!!! That's just what I was looking for...
Nothing is impossible, It's merely a question of figuring out HOW?
|
|
|
|
|
i have something wrong but not sure what to look for.
the directory that i am passing is vaild (i can use _rmdir() and it works using the same variable.
but my problem is that i do not know how may files or sub-diretories may be in the the folder that i wish to delete. From what i understand this function will delete folders that have contents. i have been trying to delete for now an empty folder dirname = c:\\junk
when i run SHFileOperation() i get:
Cannot Delete File: File System Error(1026)
if i check the attributes on the directory there is nothing checked.
thank you for any help
SHFILEOPSTRUCT shf;
memset(&shf,0,sizeof(shf));
shf.hwnd = mywindow::GetSafeHwnd();
shf.wFunc = FO_DELETE;
shf.pFrom = dirname;///////////////this is a valid directory
shf.fFlags = FOF_SIMPLEPROGRESS | FOF_NOCONFIRMATION ;
int shfret = SHFileOperation(&shf);
|
|
|
|
|
The pFrom member is a "multistring", i.e a string composed of many substrings terminated by '\0' s. In your particular case, there's only one substring terminated by '\0' plus the standard '\0' regular C strings are equipped with. So, try with "c:\\junk\0" and tell us if that worked.
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
Can anyone help me?
If I override window sizing (lock WM_NCLBUTTONDOWN / HTLEFT..HTBOTTOMRIGHT and so on until WM_LBUTTONUP), do i have to dispatch WM_ENTERSIZEMOVEs and WM_EXITSIZEMOVEs? Where do they appear - in DefWndProc main message loop or sent by WM_NCHITTEST / sizing handler?
|
|
|
|