what is the difference between CreateProcess and CreateProcessA, also are there any alternatives to these in VC++ 2008 ?
I have also a problem, that i use the CreateProcessA function, this works well in one system but fails in other systems.
Also when i use CreateProcess i get the error cannot convert 2 parameter from 'CHAR[40]' to 'LPWSTR' i am in unicode mode
First, CreateProcess is a macro that switches between CreateProcessA and CreateProcessW, which take strings in ANSI or Unicode, respectively. This depends on your project build settings (the character set project property), Unicode vs Multi-Byte. Generally, you want things to be in Unicode, as this allows for globalization and adds the option of allowing more supported languages.
The complaint in converting from char to LPCWSTR shows that it's expecting a type of WSTR, or wide string, or unicode string. A workaround is to declare your chars using the _T("blahblah") macro.
CreateProcess
is identical to either CreateProcessA
("ANSI") or to CreateProcessW
("Wide characters"), depending on whether you're compiling your code without or with the unicode option enabled.
The difference is whether the string which you pass as a parameter should be an ANSI (8-bit character) or a unicode (16-bit character) string.
There are also alternatives, like ShellExecuteEx
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With