Click here to Skip to main content
15,899,313 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: text Alignment Pin
Luc Pattyn1-Jan-12 9:07
sitebuilderLuc Pattyn1-Jan-12 9:07 
AnswerRe: text Alignment Pin
CPallini1-Jan-12 9:07
mveCPallini1-Jan-12 9:07 
QuestionMFC, c++ windows programming audio books Pin
Phil0051-Jan-12 7:31
Phil0051-Jan-12 7:31 
AnswerRe: MFC, c++ windows programming audio books Pin
Satheesh15461-Jan-12 16:59
Satheesh15461-Jan-12 16:59 
GeneralRe: MFC, c++ windows programming audio books Pin
Richard MacCutchan1-Jan-12 23:20
mveRichard MacCutchan1-Jan-12 23:20 
GeneralRe: MFC, c++ windows programming audio books Pin
Phil0053-Jan-12 1:55
Phil0053-Jan-12 1:55 
GeneralRe: MFC, c++ windows programming audio books Pin
Phil0054-Jan-12 3:57
Phil0054-Jan-12 3:57 
QuestionCreateProcessAsUser Question Pin
Lucidation30-Dec-11 11:29
Lucidation30-Dec-11 11:29 
I'm new to C++ and have been tinkering with creating a small app that uses the CreateProcessAsUser function (http://msdn.microsoft.com/en-us/library/windows/desktop/ms682429(v=vs.85).aspx). Now, everything works just fine and dandy when I'm double-clicking my .EXE to run it. The issue is that if I execute it from a Command Prompt that isn't the current directory, it errors.

This is what I'm currently using:
C++
CreateProcessAsUser(
			hPrimaryToken,
			sFileToLaunch,
			lpCommandLine,
			NULL,
			NULL,
			FALSE,
			NORMAL_PRIORITY_CLASS | CREATE_NEW_CONSOLE,
			NULL, 
			lpCurrentDirectory,
			&si,
			&pi
			);



I've got "lpCurrentDirectory" set to null, and so I thought that would solve this. Apparently it doesn't. Can anyone shed a little light on this for me? Thanks!
AnswerRe: CreateProcessAsUser Question Pin
Richard Andrew x6430-Dec-11 14:47
professionalRichard Andrew x6430-Dec-11 14:47 
GeneralRe: CreateProcessAsUser Question Pin
Lucidation31-Dec-11 11:21
Lucidation31-Dec-11 11:21 
GeneralRe: CreateProcessAsUser Question Pin
Richard Andrew x6431-Dec-11 15:06
professionalRichard Andrew x6431-Dec-11 15:06 
GeneralRe: CreateProcessAsUser Question Pin
Lucidation5-Jan-12 4:40
Lucidation5-Jan-12 4:40 
GeneralRe: CreateProcessAsUser Question Pin
Richard Andrew x645-Jan-12 8:03
professionalRichard Andrew x645-Jan-12 8:03 
GeneralRe: CreateProcessAsUser Question Pin
Lucidation5-Jan-12 13:38
Lucidation5-Jan-12 13:38 
GeneralRe: CreateProcessAsUser Question Pin
Richard Andrew x645-Jan-12 13:45
professionalRichard Andrew x645-Jan-12 13:45 
GeneralRe: CreateProcessAsUser Question Pin
Lucidation6-Jan-12 12:25
Lucidation6-Jan-12 12:25 
GeneralRe: CreateProcessAsUser Question Pin
Richard Andrew x646-Jan-12 12:53
professionalRichard Andrew x646-Jan-12 12:53 
QuestionCommand Routing From CDialogBar to CMainFrame Pin
sdancer7530-Dec-11 9:41
sdancer7530-Dec-11 9:41 
SuggestionRe: Command Routing From CDialogBar to CMainFrame Pin
Randor 30-Dec-11 15:06
professional Randor 30-Dec-11 15:06 
QuestionIntializing a structure array to store SQL Results from a class Pin
jkirkerx30-Dec-11 7:15
professionaljkirkerx30-Dec-11 7:15 
AnswerRe: Intializing a structure array to store SQL Results from a class Pin
Code-o-mat30-Dec-11 8:30
Code-o-mat30-Dec-11 8:30 
GeneralRe: Intializing a structure array to store SQL Results from a class Pin
jkirkerx30-Dec-11 9:15
professionaljkirkerx30-Dec-11 9:15 
GeneralRe: Intializing a structure array to store SQL Results from a class Pin
Code-o-mat30-Dec-11 9:33
Code-o-mat30-Dec-11 9:33 
GeneralRe: Intializing a structure array to store SQL Results from a class Pin
jkirkerx30-Dec-11 10:01
professionaljkirkerx30-Dec-11 10:01 
GeneralRe: Intializing a structure array to store SQL Results from a class Pin
Code-o-mat30-Dec-11 10:06
Code-o-mat30-Dec-11 10:06 

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.