Posted on 1999-01-18
I want to update the content of the menu after starting my application by reading a string from ini file.
I have used the following code to implement :
CMenu *CreateMenu, *SubMenu;
CreateMenu = new CMenu;
SubMenu = CreateMenu->GetSubMenu(3);
CString dbfile = ((MyApp*)::AfxGetApp())->GetProfileString
The menu had been updated after I have push a button in the
toolbar. But it cannot be updated if I put the above code inside the function CChildFrame::OnCreate(LPCREATESTRUCT lpCreateStruct). What is the reason about this?
Also, after opening a new window using another view class and menu, if I use the mouse click back to the original window, the context of the menu had been resetted.
Thus, I want to know how can I change the context of the menu after reading a string from ini file..and it will not be resetted if I open another window.
Anyone can help me?
Thank you very much!