Microsoft Foundation Classes (mfc.hlp) (Table of Contents; Topic list)
Important Notice
The pages on this site contain documentation for very old MS-DOS software, purely for historical purposes. If you're looking for up-to-date documentation, particularly for programming, you should not rely on the information found here, as it will be woefully out of date.
CMenu::GetMenuString
CMenu                                       Up Contents Index Back
──Microsoft Foundation Classes──────────────────────────────────────────────
 
  int GetMenuString( UINT nIDItem, LPSTR lpString, int nMaxCount,
                     UINT nFlags ) const;
 
  Parameter   Description
 
  <nIDItem>   Specifies the integer identifier of the menu item or the
              offset of the menu item in the menu, depending on the value
              of <nFlags>.
 
  <lpString>  Points to the buffer that is to receive the label. You can
              pass a CString object for this parameter.
 
  <nMaxCount> Specifies the maximum length (in bytes) of the label to be
              copied. If the label is longer than the maximum specified in
              <nMaxCount>, the extra characters are truncated.
 
  <nFlags>                <nFlags>        Interpretation of <nIDItem>
 
              MF_BYCOMMAND    Specifies that the parameter gives the
                              command ID of the existing menu item. This
                              is the default if neither MF_BYCOMMAND nor
                              MF_BYPOSITION is set.
 
              MF_BYPOSITION   Specifies that the parameter gives the
                              position of the existing menu item (the
                              first item is at position 0).
 
  Remarks
 
  Copies the label of the specified menu item to the specified buffer.
 
  The <nMaxCount> parameter should be one larger than the number of
  characters in the label to accommodate the null character that
  terminates a string.
 
  Return Value
 
  Specifies the actual number of bytes copied to the buffer, not including
  the null terminator.
 
  See Also
 
  CWnd::GetMenu, CMenu::GetMenuItemID, ::GetMenuString
 
 
                                     -♦-