WideToAsc(wchar_t *wp,char *p)
{
bool ret = false;
if(wp != NULL)
{
int count = WideCharToMultiByte(CP_ACP,0,wp,-1,0,0,NULL,NULL);
if(count > 0)
{
WideCharToMultiByte(CP_ACP, 0, wp, -1, p, count + 1 , NULL, NULL);
p[count] = '\0';
ret = true;
}
}
return ret;
}
{
bool ret = false;
if(wp != NULL)
{
int count = WideCharToMultiByte(CP_ACP,0,wp,-1,0,0,NULL,NULL);
if(count > 0)
{
WideCharToMultiByte(CP_ACP, 0, wp, -1, p, count + 1 , NULL, NULL);
p[count] = '\0';
ret = true;
}
}
return ret;
}
AscToWide(char *p,wchar_t *wp)
{
bool ret = false;
if(p != NULL)
{
int count = MultiByteToWideChar(CP_ACP, 0, p , strlen(p), NULL , 0);
if(count > 0)
{
MultiByteToWideChar(CP_ACP, 0, p , strlen(p), wp , count+1);
wp[count] = '\0';
ret = true;
}
}
return ret;
}
{
bool ret = false;
if(p != NULL)
{
int count = MultiByteToWideChar(CP_ACP, 0, p , strlen(p), NULL , 0);
if(count > 0)
{
MultiByteToWideChar(CP_ACP, 0, p , strlen(p), wp , count+1);
wp[count] = '\0';
ret = true;
}
}
return ret;
}