在网上也没搜到什么特别有用的,或是很方便使用的代码,故自己研究了下
LPSTR LIU_UNICODE_WCHAR_TO_LPSTR(WCHAR *input)
{
USES_CONVERSION;
CString str = input;
LPSTR output=(LPSTR)W2A(input);
return output;
}
LPCSTR LIU_UNICODE_WCHAR_TO_LPCSTR(WCHAR *input)
{
USES_CONVERSION;
CString str = input;
LPCSTR output =(LPCSTR)W2A(input);
return output;
}
LPCTSTR LIU_UNICODE_WCHAR_TO_LPCTSTR(WCHAR *input)
{
USES_CONVERSION;
CString str = input;
LPCTSTR output =(LPCTSTR)W2A(input);
return output;
}
LPCWSTR LIU_UNICODE_WCHAR_TO_LPCWSTR(WCHAR *input)
{
USES_CONVERSION;
CString str = input;
LPCWSTR output =(LPCWSTR)W2A(input);
return output;
}
LPWSTR LIU_UNICODE_WCHAR_TO_LPWSTR(WCHAR *input)
{
USES_CONVERSION;
CString str = input;
LPWSTR output =(LPWSTR)W2A(input);
return output;
}