The information in this article applies to:
SYMPTOMSIf you call CFile::GetFileName(), it will return a CString with the correct file name. However, if you call GetLength() on the CString, it will return 0. CAUSEThe MFC function CFile::GetFileName() writes directly to the CString's character pointer. However, it doesn't set the CString's size before returning from this function. RESOLUTIONCall CString::ReleaseBuffer() after calling CFile::GetFileName(). STATUSMicrosoft has confirmed this to be a bug in the Microsoft products listed at the beginning of this article. This bug was corrected in Visual C++ 4.1. MORE INFORMATIONSample Code
Additional query words: kbVC400bug 4.00 4.10 GetFileName GetLength CFile CString
Keywords : kbMFC KbUIDesign kbVC kbVC410fix |
Last Reviewed: July 22, 1999 © 2000 Microsoft Corporation. All rights reserved. Terms of Use. |