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

C / C++ / MFC

 
GeneralRe: Problem with socket Pin
ThatsAlok2-Mar-05 23:19
ThatsAlok2-Mar-05 23:19 
GeneralRe: Problem with socket Pin
vishalmore3-Mar-05 2:40
vishalmore3-Mar-05 2:40 
GeneralPlease help me immediatly Pin
ikram_ktk2-Mar-05 20:33
ikram_ktk2-Mar-05 20:33 
GeneralRe: Please help me immediatly Pin
Ravi Bhavnani3-Mar-05 3:59
professionalRavi Bhavnani3-Mar-05 3:59 
Generalchallenging one Pin
mpapeo2-Mar-05 19:34
mpapeo2-Mar-05 19:34 
GeneralRe: challenging one Pin
jan larsen2-Mar-05 20:19
jan larsen2-Mar-05 20:19 
GeneralRe: challenging one Pin
mpapeo2-Mar-05 22:17
mpapeo2-Mar-05 22:17 
GeneralRe: challenging one Pin
jan larsen2-Mar-05 22:39
jan larsen2-Mar-05 22:39 
mpapeo wrote:
About pi.process i thought the created process will be the one to readmemory of...

You tell me Smile | :)
What is wrong in the code though, is that you declare the variable pi, which is to be filled by the function CreateProcess. However, before actually filling that struct, you assign the value of one of it's members to the variable hProcess.
I don't know about the rest of the code, but you have to switch the steps here from:
PROCESS_INFORMATION pi; /* filled in by CreateProcess */
HANDLE hProcess = pi.hProcess; 

to
PROCESS_INFORMATION pi; /* filled in by CreateProcess */
HANDLE hProcess = NULL 

...

// Call CreateProcess, telling it to run an exe file
CreateProcess(NULL, /* lpApplicationName */
"numbers.exe", /* lpCommandLine assumes to use curent process directory*/
NULL, /* lpsaProcess */
NULL, /* lpsaThread */
FALSE, /* bInheritHandles */
CREATE_NEW_CONSOLE, /* dwCreationFlags */
NULL, /* lpEnvironment */
NULL, /* lpCurDir */
&si, /* lpStartupInfo */
&pi /* lpProcInfo */
);

hProcess = pi.hProcess;



That is of course assuming that CreateProcess succeeded. There is, in my opinion, a lack of result testing. This is of course essential to production code, but also when you are in a test phase, it would help you a lot in finding the errors.


"After all it's just text at the end of the day. - Colin Davies

"For example, when a VB programmer comes to my house, they may say 'does your pool need cleaning, sir ?' " - Christian Graus
GeneralRe: challenging one Pin
mpapeo4-Mar-05 11:02
mpapeo4-Mar-05 11:02 
QuestionHow 2 make a string of 10 * in a row? Pin
jj2jj22-Mar-05 18:55
jj2jj22-Mar-05 18:55 
AnswerRe: How 2 make a string of 10 * in a row? Pin
ThatsAlok2-Mar-05 19:11
ThatsAlok2-Mar-05 19:11 
AnswerRe: How 2 make a string of 10 * in a row? Pin
jones20003-Mar-05 1:48
jones20003-Mar-05 1:48 
General[IFileSystem ] Problem using IFileSystem Interface from scrrun.dll Pin
Member 862302-Mar-05 18:47
Member 862302-Mar-05 18:47 
GeneralQuestion about window's state!!! Pin
kokehqyu2-Mar-05 18:45
kokehqyu2-Mar-05 18:45 
GeneralRe: Question about window's state!!! Pin
Ravi Bhavnani3-Mar-05 3:55
professionalRavi Bhavnani3-Mar-05 3:55 
GeneralRe: Question about window's state!!! Pin
kokehqyu3-Mar-05 17:39
kokehqyu3-Mar-05 17:39 
GeneralDevstudio addin Ques Pin
Jetli Jerry2-Mar-05 18:37
Jetli Jerry2-Mar-05 18:37 
GeneralMFC MDI with sound! Pin
Member 14844962-Mar-05 18:24
Member 14844962-Mar-05 18:24 
GeneralRe: MFC MDI with sound! Pin
David Crow3-Mar-05 2:17
David Crow3-Mar-05 2:17 
Questionhow do i..... Pin
namaskaaram2-Mar-05 17:27
namaskaaram2-Mar-05 17:27 
AnswerRe: how do i..... Pin
Steen Krogsgaard2-Mar-05 21:12
Steen Krogsgaard2-Mar-05 21:12 
GeneralRe: how do i..... Pin
namaskaaram2-Mar-05 22:08
namaskaaram2-Mar-05 22:08 
GeneralRe: how do i..... Pin
Steen Krogsgaard2-Mar-05 23:47
Steen Krogsgaard2-Mar-05 23:47 
GeneralRe: how do i..... Pin
namaskaaram3-Mar-05 17:28
namaskaaram3-Mar-05 17:28 
GeneralProblem with polymorphism Pin
ng kok chuan2-Mar-05 17:14
ng kok chuan2-Mar-05 17:14 

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.