Article ID: 217208 - View products that this article applies to.
This article was previously published under Q217208
This article has been archived. It is offered "as is" and will no longer be updated.
The CMenu::GetMenuString method truncates menu strings longer than 256 characters. This problem is most commonly seen when retrieving a file name from the "most recently used" list on the File menu. These file names are occasionally longer than 256 characters.
The CMenu member function int CMenu::GetMenuString(UINT nIDItem, CString& rString, UINT nFlags) const, hard codes the maximum length for a retrieved menu string at 256 characters. See VC98\MFC\Include\Afxwin.h, line 1043.
To work around this problem, use the LPTSTR version of this function; for example, int CMenu::GetMenuString(UINT nIDItem, LPTSTR lpString, int nMaxCount, UINT nFlags) const.
Microsoft has confirmed that this is a bug in the Microsoft products that are listed in the "Applies to" section.
This bug was corrected in Visual Studio 6.0 Service Pack 3. For more information about Visual Studio service packs, click the following article numbers to view the articles in the Microsoft Knowledge Base:
(http://support.microsoft.com/kb/194022/ )Visual Studio 6.0 service packs, what, where, why
(http://support.microsoft.com/kb/194295/ )How to tell that a Visual Studio service pack is installed
Steps to reproduce the behavior
Article ID: 217208 - Last Review: February 21, 2014 - Revision: 4.1
Contact us for more help