A Alamelu Mar 22, 2009 #1 I am take string input from int main arguments, how to convert those strings to wide character strings
I am take string input from int main arguments, how to convert those strings to wide character strings
G Giovanni Dicanio Mar 22, 2009 #2 Alamelu said: I am take string input from int main arguments, how to convert those strings to wide character strings Click to expand... There are several options. You may want to use the ATL helper conversion classes, like CA2W: const char * ansiString ... CA2W wideString( ansiString ); And use wideString wherever a const wchar_t * is required. Or CStringW class has a constructor to do the conversion: CStringW wideString( ansiString ); Note that you can use these ATL classes from both pure Win32 C++ projects and MFC projects. HTH, Giovanni
Alamelu said: I am take string input from int main arguments, how to convert those strings to wide character strings Click to expand... There are several options. You may want to use the ATL helper conversion classes, like CA2W: const char * ansiString ... CA2W wideString( ansiString ); And use wideString wherever a const wchar_t * is required. Or CStringW class has a constructor to do the conversion: CStringW wideString( ansiString ); Note that you can use these ATL classes from both pure Win32 C++ projects and MFC projects. HTH, Giovanni
D David Wilkinson Mar 22, 2009 #3 Alamelu said: I am take string input from int main arguments, how to convert those strings to wide character strings Click to expand... Alemelu: In addition to Giovanni's answer, if you use wmain() or _tmain() instead of main() then the arguments are already presented as wide strings.
Alamelu said: I am take string input from int main arguments, how to convert those strings to wide character strings Click to expand... Alemelu: In addition to Giovanni's answer, if you use wmain() or _tmain() instead of main() then the arguments are already presented as wide strings.
F fineman Mar 23, 2009 #4 You can use MultiByteToWideChar API. get more help, search "Unicode and Character Set Reference" in the MSDN.
You can use MultiByteToWideChar API. get more help, search "Unicode and Character Set Reference" in the MSDN.