CString的GetLength()函数返回为0问题解决

阅读 63

2023-04-18


----------------------------------------------------
“If   you   use   the   pointer   returned   by   GetBuffer   to   change   the   string   contents,   you   must   call   ReleaseBuffer   before   using   any   other   CString   member   functions.   ” 

  即调用GetLength()之前,先掉用ReleaseBuffer()函数;

例如:

S.ReleaseBuffer();
  for(i=0; i<S.GetLength(); i++) // 对加密结果进行转换
  { }

精彩评论(0)

0 0 举报