How to use multi byte character set in vs2008 ATL
-
when create atl project, then set multi-byte character, compile, I got error: DllInstall: error C2440: 'initializing' : cannot convert from 'const char [5]' to 'const wchar_t []' then try to modify: form STDAPI DllInstall(BOOL bInstall, LPCWSTR pszCmdLine) to STDAPI DllInstall(BOOL bInstall, LPCSTR pszCmdLine) compile: error C2733: second C linkage of overloaded function 'DllInstall' not allowed any ideas? thanks!
modified on Friday, April 11, 2008 12:30 AM
-
when create atl project, then set multi-byte character, compile, I got error: DllInstall: error C2440: 'initializing' : cannot convert from 'const char [5]' to 'const wchar_t []' then try to modify: form STDAPI DllInstall(BOOL bInstall, LPCWSTR pszCmdLine) to STDAPI DllInstall(BOOL bInstall, LPCSTR pszCmdLine) compile: error C2733: second C linkage of overloaded function 'DllInstall' not allowed any ideas? thanks!
modified on Friday, April 11, 2008 12:30 AM
Robe wrote:
when create atl project, then set multi-byte character, compile, I got error: DllInstall: error C2440: 'initializing' : cannot convert from 'const char [5]' to 'const wchar_t []'
Another way to solve your problem would be to use the system function
MultibyteToWideChar
to convert your message to unicode when you callDllInstall
. (If you're in charge of calling it, that is.) The other solution I can think of would be to just use a unicode project, depending on how much you would have to change for it. Nathan -
Robe wrote:
when create atl project, then set multi-byte character, compile, I got error: DllInstall: error C2440: 'initializing' : cannot convert from 'const char [5]' to 'const wchar_t []'
Another way to solve your problem would be to use the system function
MultibyteToWideChar
to convert your message to unicode when you callDllInstall
. (If you're in charge of calling it, that is.) The other solution I can think of would be to just use a unicode project, depending on how much you would have to change for it. NathanYou can change the static const wchar_t szUserSwitch[] = _T("user"); with static const wchar_t szUserSwitch[] = L"user"; regards