Andrew Talbot wrote:
Robert Shearman wrote:
Sorry, this is wrong. If InsertMenuItemA writes to the string then it will be corrupted and will display the wrong thing for further uses in the process.
A MENUITEMINFOA's dwTypeData is currently declared as writeable (LPSTR); what it is initialised from will not affect that.
Sorry. On reflection, I see that my thinking was faulty: I now realise that the structure member points to the initialising or assigning string - rather than getting a copy of the data from it - so the writeability of the latter does matter.
-- Andy.