Other Languages - CreateProcess - Asked By gungun saini on 20-Nov-11 11:53 PM

Earn up to 20 extra points for answering this tough question.
Hello All,

        I run a process using createProcess in vc++. I need output also for i want to access RedirectStandardInput,RedirectStandardOutput,RedirectStandardError . I did not create object of Process.i dont want to use <System.dll> and namespace in my project .when i used this appliction became framework dependent. i want to remove framework dependency.











Regards,

gungun
Anil Kumar replied to gungun saini on 21-Nov-11 08:06 AM
Hi Gungun,

You most probably forgot to set the UNICODE define or a wrong. UNICODE is defined.

Thank you
Anil

Anil Kumar replied to gungun saini on 21-Nov-11 08:07 AM
Upload the coding also, we could look into it to rectify the error.
Thank you
Anil
Anil Kumar replied to gungun saini on 21-Nov-11 08:14 AM
Also, some important point to keep in mind:

 You must set UseShellExecute to false if you want to set RedirectStandardInput,RedirectStandardOutput,RedirectStandardError to true. Also refer to the article for the better understanding of the situation:
http://msdn.microsoft.com/en-us/library/system.diagnostics.processstartinfo.redirectstandardoutput.aspx
http://msdn.microsoft.com/en-us/library/system.diagnostics.processstartinfo.redirectstandarderror.aspx
http://msdn.microsoft.com/en-us/library/system.diagnostics.processstartinfo.redirectstandardinput.aspx

Thank you
Anil

Sam replied to gungun saini on 04-Dec-11 07:26 PM
Are you saying you want to use CreateProcess directly using the Windows API without .Net? If so, then have you see:

http://msdn.microsoft.com/en-us/library/ms682499(VS.85).aspx

Is that the type of thing you are looking for? I know that that sample is not written very well but it works.