FIX: CMenu::GetMenuString Truncates Strings Longer Than 256 CharactersID: Q217208
|
CMenu::GetMenuString 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 this to be a bug in the Microsoft products listed
at the beginning of this article.
This bug was corrected in Visual Studio 6.0 Service Pack 3.
For more information about Visual Studio service packs, please see the following articles in the Microsoft Knowledge Base:
Q194022 INFO: Visual Studio 6.0 Service Packs, What, Where, Why
Q194295 HOWTO: Tell That Visual Studio 6.0 Service Packs Are Installed
Additional query words:
Keywords : kbservicepack kbMFC KbUIDesign kbVC600bug kbVS600sp2 kbVS600SP1 kbVS600sp3fix
Version : winnt:6.0
Platform : winnt
Issue type : kbbug
Last Reviewed: May 19, 1999