Click here to Skip to main content
15,902,913 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionReplace character in string Pin
manju#1239-May-08 0:30
manju#1239-May-08 0:30 
AnswerRe: Replace character in string Pin
Rajkumar R9-May-08 0:35
Rajkumar R9-May-08 0:35 
AnswerRe: Replace character in string Pin
Hamid_RT9-May-08 0:38
Hamid_RT9-May-08 0:38 
AnswerRe: Replace character in string Pin
CPallini9-May-08 0:38
mveCPallini9-May-08 0:38 
JokeRe: Replace character in string Pin
Rajesh R Subramanian9-May-08 0:55
professionalRajesh R Subramanian9-May-08 0:55 
GeneralRe: Replace character in string Pin
CPallini9-May-08 0:58
mveCPallini9-May-08 0:58 
AnswerRe: Replace character in string Pin
Rajesh R Subramanian9-May-08 0:43
professionalRajesh R Subramanian9-May-08 0:43 
QuestionExecuting exe in others' user context??? Pin
sandeepkavade9-May-08 0:23
sandeepkavade9-May-08 0:23 
Hi,
i want to execute a exe in other's context so i tried the following code

HANDLE hUserToken;
LogonUser(_T("username"),_T("domain"), _T("password"), LOGON32_LOGON_INTERACTIVE, LOGON32_PROVIDER_DEFAULT, &hUserToken);
STARTUPINFO startupInfo;
memset(&startupInfo, '\0', sizeof(startupInfo));
startupInfo.cb = sizeof(startupInfo);
startupInfo.dwFlags = STARTF_USESHOWWINDOW;
startupInfo.wShowWindow = SW_SHOW;

PROCESS_INFORMATION procInfo;
memset(&procInfo, '\0', sizeof(procInfo));


BOOL b = CreateProcessAsUser(hUserToken, fileName.c_str(),
NULL, NULL, NULL, FALSE, CREATE_NEW_CONSOLE, NULL, NULL, &startupInfo, &procInfo);
DWORD dw = GetLastError();
}

but i get the dw = 1314 saying "A required privilege is not held by the client."
If i right click the exe and choose the run as option giving user name and password it works fine. but how to execute that through code? Where i am going wrong?
AnswerRe: Executing exe in others' user context??? Pin
Rajkumar R9-May-08 0:51
Rajkumar R9-May-08 0:51 
QuestionDrawing Question Pin
Der M8-May-08 23:47
Der M8-May-08 23:47 
AnswerRe: Drawing Question Pin
Hamid_RT9-May-08 0:21
Hamid_RT9-May-08 0:21 
GeneralRe: Drawing Question Pin
Der M9-May-08 1:23
Der M9-May-08 1:23 
GeneralRe: Drawing Question Pin
Hamid_RT9-May-08 6:20
Hamid_RT9-May-08 6:20 
GeneralRe: Drawing Question Pin
Der M13-May-08 1:44
Der M13-May-08 1:44 
QuestionHow do I use MFC in MS VC++ 2008 Express? Pin
False Chicken8-May-08 23:41
False Chicken8-May-08 23:41 
AnswerRe: How do I use MFC in MS VC++ 2008 Express? Pin
Rajesh R Subramanian8-May-08 23:44
professionalRajesh R Subramanian8-May-08 23:44 
QuestionRe: How do I use MFC in MS VC++ 2008 Express? Pin
CPallini8-May-08 23:54
mveCPallini8-May-08 23:54 
JokeRe: How do I use MFC in MS VC++ 2008 Express? Pin
Rajesh R Subramanian8-May-08 23:56
professionalRajesh R Subramanian8-May-08 23:56 
GeneralRe: How do I use MFC in MS VC++ 2008 Express? Pin
CPallini9-May-08 0:01
mveCPallini9-May-08 0:01 
GeneralRe: How do I use MFC in MS VC++ 2008 Express? Pin
CPallini9-May-08 0:15
mveCPallini9-May-08 0:15 
GeneralRe: How do I use MFC in MS VC++ 2008 Express? Pin
Rajkumar R9-May-08 0:22
Rajkumar R9-May-08 0:22 
AnswerRe: How do I use MFC in MS VC++ 2008 Express? Pin
Rajkumar R9-May-08 0:03
Rajkumar R9-May-08 0:03 
GeneralRe: How do I use MFC in MS VC++ 2008 Express? Pin
CPallini9-May-08 0:07
mveCPallini9-May-08 0:07 
GeneralRe: How do I use MFC in MS VC++ 2008 Express? Pin
Rajkumar R9-May-08 0:19
Rajkumar R9-May-08 0:19 
AnswerRe: How do I use MFC in MS VC++ 2008 Express? Pin
Hamid_RT9-May-08 0:09
Hamid_RT9-May-08 0:09 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.