想实现取 lpstr数据的前2位,4位,6位,或者后2位的写法
xnt 2004-12-05 11:56:03 //想实现取 lpstr的前2位,4位,6位,或者后2位的写法.lpstr 为128个字节长度
//请问如何来写,不能使用CString类.
清讲的详细些,谢谢!
BOOL GenerateResultString(HIMC hIMC,LPSTR lpStr)
{
if ( lpStr == NULL)
{
ClearCompStr(hIMC);
ClearCandidate(hIMC);
// DebugLog(1,(DebugLogFile,"NULL pointer,Result String:%s\n",GETLPRESULTSTR(lpCompStr)));
}
else
{
LPINPUTCONTEXT lpIMC ;
LPCOMPOSITIONSTRING lpCompStr;
lpIMC = ImmLockIMC(hIMC);
lpCompStr = (LPCOMPOSITIONSTRING)ImmLockIMCC(lpIMC->hCompStr);
///////
//CString cstrwhq;
//cstrwhq=lpstr;
//lpstr=cstrwhq.Left(1);
//想实现取 lpstr的前2位,4位,6位,或者后2位的写法.lpstr 为128个字节长度
//请问如何来写,不能使用CString类.
_tcscpy(GETLPRESULTSTR(lpCompStr),lpStr);
lpCompStr->dwResultStrLen = _tcslen(lpStr);
DebugLog(1,(DebugLogFile,"Result String:%s\n",GETLPRESULTSTR(lpCompStr)));
ImmUnlockIMCC(lpIMC->hCompStr);
ImmUnlockIMC(hIMC);
}
GenerateCompMessage(hIMC);
return TRUE;
}