如果CString是从GetPrivateProfileStr()返回的
记得return 该CString 前 释放buffer
要不,CString.GetLength()将返回0
找了半天原因,
----------------------------------------------------
“If you use the pointer returned by GetBuffer to change the string contents, you must call ReleaseBuffer before using any other CString member functions. ”
在i=m_SZFileName.GetLength()之前调用m_SZFileName.ReleaseBuffer()就可以了。
记得return 该CString 前 释放buffer
要不,CString.GetLength()将返回0
找了半天原因,
----------------------------------------------------
“If you use the pointer returned by GetBuffer to change the string contents, you must call ReleaseBuffer before using any other CString member functions. ”
在i=m_SZFileName.GetLength()之前调用m_SZFileName.ReleaseBuffer()就可以了。