bool UCharToChar(UCHAR* ucStr, int ilen, char* cStr){
char *pStr = new char [ilen+1];
try{
for(int i=0;i<ilen;i++)
pStr[i] = ucStr[i];
pStr[ilen] ='\0';
strcpy(cStr,pStr);
}
catch(...)
{
if(pStr){
delete pStr;
pStr = NULL;
}
return false;
}
if(pStr){
delete pStr;
pStr = NULL;
}
return true;
}
沒有留言:
張貼留言