CreateProcess problems

  • Thread starter Thread starter genush
  • Start date Start date
G

genush

Guest
I am having a couple of problems trying to run CreateProcess. First problem, I created a test program in Visual Studio 2010 and it worked fine. The expected type of the second parameter is LPWSTR. Then I added a call to CreateProcess to a program that was converted from VC 6.0 to VS 2010. In that converted program the expected type of the second parameter is LPSTR. Why would the types be different between a converted VS 2010 program and one created with VS 2010?

The second problem I'm having is that I convert a CString to LPSTR for the second parameter. When I look at the converted CString in the debugger, the LPSTR variable looks fine. However, when I pass it to CreateProcess, the string gets truncated at the first space, and of course CreateProcess fails. When I pass an LPWSTR to CreateProcess in my test program, the string doesn't get truncated at the first space, all spaces are preserved.

So I need to figure out either how to have a CreateProcess in my converted program that takes an LPWSTR parameter as the second parameter or how to create an LPSTR parameter with spaces that get preserved when calling CreateProcess.


genush

Continue reading...
 
Back
Top