i must say im new to win32 c++ programming so i face a problem that
some code compile in Multi-Byte Character Set and not in Unicode Character Set.
how can my code support both ?
for example this NOT compiles in Multi-byte only in Unicode and the commented vector only in MultiByte:
//vector<char> str2(FullPathToExe.begin(), FullPathToExe.end());
vector<wchar_t> str2(FullPathToExe.begin(), FullPathToExe.end());
str2.push_back('\0');
if (!CreateProcess(NULL,
&str2[0],
NULL,
NULL,
TRUE,
0,
NULL,
NULL,
&si,
&pi))
Use TCHAR as the character type (e.g. std::vector<TCHAR>), which is:
A
WCHARifUNICODEis defined, aCHARotherwise.This type is declared in WinNT.h as follows:
#ifdef UNICODE typedef WCHAR TCHAR; #else typedef char TCHAR; #endif
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