16,471
社区成员
发帖
与我相关
我的任务
分享
ing g____ansi_codepage = 0;
//**************************************
// ansi字符串转unicode字符串
// 返回大于0成功,小于0失败
//**************************************
int
astr_ustr( char *ansistr, WCHAR *unicodestr )
{
int result = 0;
try
{
int needlen = MultiByteToWideChar( g____ansi_codepage, 0, ansistr, -1, NULL, 0 );
if( needlen < 0 )
{
return needlen;
}
result = MultiByteToWideChar( g____ansi_codepage, 0, ansistr, -1, unicodestr, needlen );
if( result < 0 )
{
return result;
}
return result;
}
catch( ... )
{
ShowError();
}
return result;
}