积极答复者
VS2010中CMainFrame::OnCreate()函数里用GetMenu()无法获取菜单指针。

问题
答案
-
VS2010建的SDI/MDI与之前的不一样,是类似BCG的一些东西,所以用之前的方法GetMenu()得到CMenu是NULL或者无效。
您可以在CMainFrame类中找到CMFCMenuBar m_wndMenuBar;这个成员变量,如果您将跟它相关的代码注释掉的话,然后再试试GetMenu()函数看看。
Visual C++ enthusiast, like network programming and driver development. At present is being engaged in the WinCE/Windows Mobile platform embedded development.- 已标记为答案 难得改a 2011年7月11日 0:32
全部回复
-
VS2010建的SDI/MDI与之前的不一样,是类似BCG的一些东西,所以用之前的方法GetMenu()得到CMenu是NULL或者无效。
您可以在CMainFrame类中找到CMFCMenuBar m_wndMenuBar;这个成员变量,如果您将跟它相关的代码注释掉的话,然后再试试GetMenu()函数看看。
Visual C++ enthusiast, like network programming and driver development. At present is being engaged in the WinCE/Windows Mobile platform embedded development.- 已标记为答案 难得改a 2011年7月11日 0:32
-
VS2010建的SDI/MDI与之前的不一样,是类似BCG的一些东西,所以用之前的方法GetMenu()得到CMenu是NULL或者无效。
您可以在CMainFrame类中找到CMFCMenuBar m_wndMenuBar;这个成员变量,如果您将跟它相关的代码注释掉的话,然后再试试GetMenu()函数看看。
Visual C++ enthusiast, like network programming and driver development. At present is being engaged in the WinCE/Windows Mobile platform embedded development.
这明显不是个好方法,还有吗?