I try to start console application from MFC application using CreateProcess.
cmd variable is CString which contains the application name and command line arg which is chineese UTF8 file name.
The file name is not passed in UTF8 format and the application fails.
How can I send the command in the right way?
BOOL bRetVal = ::CreateProcess( NULL,
cmd.GetBuffer(m_strProg.GetLength()), // Command line.
NULL, // Process handle not inheritable.
NULL, // Thread handle not inheritable.
FALSE, // Set handle inheritance to FALSE.
0, // No creation flags.
NULL, // Use parent's environment block.
NULL, // Use parent's starting directory.
&si, // Pointer to STARTUPINFO structure.
&pi // Pointer to PROCESS_INFORMATION structure.
);