16,472
社区成员
发帖
与我相关
我的任务
分享
static DWORD CALLBACK EditStreamInCallBack(DWORD dwCookie, LPBYTE pbBuff, LONG cb, LONG *pcb)
{
CString *pstr = (CString *)dwCookie;
if (pstr->GetLength() < cb)
{
*pcb = pstr->GetLength();
memcpy(pbBuff, (LPCSTR)*pstr, *pcb);
pstr->Empty();
}
else
{
*pcb = cb;
memcpy(pbBuff, (LPCSTR)*pstr, *pcb);
*pstr = pstr->Right(pstr->GetLength() - cb);//主要是这里我不知道用wstring时如何写。
}
return 0;
}
#ifdef _UNICODE
wstring ws(cstr);
#else
string s(cstr);
#endif