/*------------------------------------------------------------------------------
把ASCII字符串转换成UNICODE字符串
[input]: source=源ASCII字符串
[output]: obj=目标UNICODE字符串
*/
DWORD ConvertAnsiTounicode(char* source,TCHAR* obj)
{
DWORD nLength = 0;
nLength = MultiByteToWideChar(CP_ACP,0,source,-1,NULL,0);
MultiByteToWideChar(CP_ACP,0,source,-1,obj,nLength);
return nLength;
}
/*------------------------------------------------------------------------------
把UNICODE字符串转换成ASCII字符串
[input]: source=源UNICODE字符串
[output]: obj=目标ASCII字符串
*/
DWORD ConvertUnicodeToAnsi(TCHAR* source,char* obj)//,int& nLength)
{
DWORD nLength = 0;
nLength = WideCharToMultiByte(CP_ACP,0,source,-1,NULL,0,NULL,NULL);
WideCharToMultiByte(CP_ACP,0,source,-1,obj,nLength,NULL,NULL);
return nLength;
}