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

来源:互联网 发布:php商城开源 编辑:程序博客网 时间:2024/05/18 16:35


----------------------------------------------------
“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++) // 对加密结果进行转换
 { 

}

原创粉丝点击