Introduction - If you have any usage issues, please Google them yourself
This program shows how to dynamically add menu items.
To use it in your application copy m_dynamicitem and n_dynamicitem to a library in your target and an instance variable to your menu object. Then add a function to your window that is called by the clicked event in m_dynamicitem.