Creating Sub (sub) menus dynamically at run time



I'm trying to create/modify my menu at run-time. I can modify the menu
to one level deep easily enough, as follows:

// 1. VIEW MENU (CHANGE DEPENDING ON AUTOCAD OR LEAD)
// 1.1 Get the menu from the application window.
CMenu* mmenu = m_pApp.m_MainFrame->GetMenu();

// 1.2 Look for "OVERLAY" menu.
int pos = FindMenuItem(mmenu, "Overlay");
if (pos == -1) return;
CMenu *submenu = mmenu->GetSubMenu(pos);

// 1.3 Delete Current Menu Items
for (int i=submenu->GetMenuItemCount();i>=0;--i)
submenu->DeleteMenu(i, MF_BYPOSITION);

pos = 0;
submenu->InsertMenu(pos, MF_BYPOSITION, ID_OVERLAY_ROTATE45CW, "Rotate
45° CCW" );
submenu->InsertMenu(pos+1, MF_BYPOSITION, ID_OVERLAY_ROTATE45CW,
"Rotate 45° CW" );
etc.

This works fine. But what I need to do is make a menu/submenu/submenu.

Like:

File Edit Overlay
Rotate ->
sub menu item 1 (THIS IS WHAT I CANNOT FIGURE
OUT)
sub menu item 2
Other menu item 1
Other menu item 2

Does any body have any ideas? Thank you,

.