Hello.
It was made a menu dynamically.
However, it is not started in the form that all the menus were displayed.

Please teach a way displayed entirely.
Please answer it as soon as possible.
CExtPopupMenuWnd * pPopup;
CPoint cPointPop;
pPopup = new CExtPopupMenuWnd;
pPopup->CreatePopupMenu( AfxGetMainWnd()->GetSafeHwnd() );
CMenu menuWidthCommands;
CMenu popupMenu;
BOOL bCreate;
bCreate = menuWidthCommands.CreateMenu();
bCreate = popupMenu.CreatePopupMenu ();
bCreate = popupMenu.AppendMenu ( MF_STRING, 32123 /*ID_SEPARATOR*/ , "aaaa" );
bCreate = popupMenu.AppendMenu ( MF_STRING, 32124 /*ID_SEPARATOR*/ , "bbbb" );
bCreate = menuWidthCommands.AppendMenu ( MF_POPUP, ( UINT ) popupMenu.Detach (), "_POPUP_" );
pPopup->UpdateFromMenu(
//GetSafeHwnd() ,
AfxGetMainWnd()->GetSafeHwnd() ,
&menuWidthCommands
);
::GetCursorPos( &cPointPop );
pPopup->TrackPopupMenu (
TPM_RIGHTBUTTON | TPM_TOPALIGN | TPM_LEFTALIGN ,
cPointPop.x ,
cPointPop.y
);