Hi again,
After being able to resize and move around the console application I'm trying to tackle the redirect input.
I used the example given in this url:
http://msdn.microsoft.com/en-us/library/system.diagnostics.processstartinfo.redirectstandardinput.aspx
and it worked great UNTIL I changed the "sort.exe" to be "cmd.exe" or a batch file.
Once I changed the process to start the "cmd.exe" or a very basic batch file (that only does "echo" and "set /p") I wasn't able to start the process anymore.
I went into debugging mode and I noticed that the process exits immediately after it "starts" (if it starts at all).
I dug a little dipper and I noticed that the process MainModule had this exception:
base {System.Runtime.InteropServices.ExternalException} = {"A 32 bit processes cannot access modules of a 64 bit process."}
I'm using Windows 7 Ultimate x64 and visual studio 2010.
I tried compiling the project with every combination of "platform" and "Active platform" (x64, x86, anyPCU for each) and all it got me is that when I used x64 in the "platform" (regardless of the active platform) I got the following
exception instead:
base {System.Runtime.InteropServices.ExternalException} = {"Only part of a ReadProcessMemory or WriteProcessMemory request was completed"}
Google wasn't very helpful with either of those exceptions and only led me to a microsoft KB stating they have hotfix for windows visa (but not for windows 7).
Needless to say that when I use the same code while "process.startinfo.redirectstandardinput = false" it starts the batch file and the "cmd.exe" just fine (without redirecting the input of course).
My question is, how can I redirect the input to a process that starts the "cmd.exe" or a batch file?
Thanks in advance,
daat99
I always try to help ;) sometimes I don't know how :(