mfc-feature-pack

Disable/Enable Ribbon Buttons for MFC Feature Pack

只谈情不闲聊 提交于 2019-12-10 15:22:12
问题 I am using the MFC Feature Pack and I have some buttons on a ribbon bar, instances of CMFCRibbonButton. The problem is that I would like to enable and disable some of them in certain conditions, but at runtime. How can I do this? because there is no specific method for this...I heard that a solution would be to attach/detach the event handlers at runtime, but I do not know how... 回答1: When you create the CMFCRibbonButton object you have to specify the associated command ID (see the

Converting registry access to db calls from MFC Feature Pack

我只是一个虾纸丫 提交于 2019-12-08 00:00:14
问题 We may start converting an old VS2003 MFC project to use the fancy new features provided by the MFC Feature Pack and VS2008. Several of the new UI controls would be very nice except for one thing - they automatically save their information to the registry. I don't have a problem with the registry, but for the multiple environments the users use out program from, it's much easier to save user data to the database. So, I'm hoping that there is one main "access the registry" function that could

Is it possible to add CMFCToolBar to a dialog?

柔情痞子 提交于 2019-12-07 21:56:36
问题 I just tryed the standard way for adding CToolbar to a dialog on the new CMFCToolBar. But it doesn't work. Befor I dip into the new implementation, I want to know if it actually possible? 回答1: I'm not sure what you mean by "the standard way", but you can certainly do it programatically: // In MyDlg.h class CMyDlg : public CDialog { ... CMFCToolBar m_ToolBar; ... }; // In MyDlg.cpp BOOL CMyDlg::OnInitDialog() { ... if( m_ToolBar.Create( this, AFX_DEFAULT_TOOLBAR_STYLE, 100 ) ) { m_ToolBar

Is it possible to manipulate the menu of my CMDIFrameWndEx's CMFCMenuBar?

喜你入骨 提交于 2019-12-07 10:11:09
问题 My main frame has a CMFCMenuBar member, which contains the menu of the current document type. I would like to add/remove a sub-menu dynamically. For example, if the user chooses to display a map pane, I want to add a map submenu next to the "File" menu. Vice versa, if the map pane gets closed, I also want to remove the map menu items. One thing that works but which I don't like is to simply disable the menu items in the ON_UPDATE_COMMAND_UI handlers. The Frame has a method called GetMenuBar()

Converting registry access to db calls from MFC Feature Pack

爷,独闯天下 提交于 2019-12-06 13:21:37
We may start converting an old VS2003 MFC project to use the fancy new features provided by the MFC Feature Pack and VS2008. Several of the new UI controls would be very nice except for one thing - they automatically save their information to the registry. I don't have a problem with the registry, but for the multiple environments the users use out program from, it's much easier to save user data to the database. So, I'm hoping that there is one main "access the registry" function that could be overloaded to point the database. But brief investigation hasn't turned up anything. Has anyone else

Is it possible to manipulate the menu of my CMDIFrameWndEx's CMFCMenuBar?

主宰稳场 提交于 2019-12-05 16:16:49
My main frame has a CMFCMenuBar member, which contains the menu of the current document type. I would like to add/remove a sub-menu dynamically. For example, if the user chooses to display a map pane, I want to add a map submenu next to the "File" menu. Vice versa, if the map pane gets closed, I also want to remove the map menu items. One thing that works but which I don't like is to simply disable the menu items in the ON_UPDATE_COMMAND_UI handlers. The Frame has a method called GetMenuBar() but that one returns me a const CMFCMenuBar * so I can't modify it from the outside. I added a getter

How can I place a MFC CFormView inside a CDockablePane?

跟風遠走 提交于 2019-12-04 07:13:18
How can I place a MFC CFormView inside a CDockablePane which was introduced in the VS 2008 MFC Feature Pack? Check the BCGSoft Samples for doing this with a cview. The class names are a little different but its more or less the same stuff since they provided CDockablePane to Microsoft. I couldn't find such samples in MFC Feature Pack samples. All projects containing CFormView are : TasksPane TabControl TabbedView StatusBarDemo SetPaneSize MenuSubSet But in any of the projects, CFormView is not embedded in CDockablePane. There is a sample of the feature pack that does this. However, what I do

C++ MFC Feature Pack --> Create multiple CDockablePanes onto an CDialog

六眼飞鱼酱① 提交于 2019-12-02 17:17:43
问题 I try to create an area onto a CDialog, where I can put some CDockablePanes in. Those shall be perfectly dockable to a fixed dialog content. The Codejock Dialog Panes Sample is exactly what I want, but realized with the MFC feature pack classes: http://codejock.com/downloads/samples/dockingpane.asp At the moment I got a class inherited from CFrameWndEx, which is embedded in the CDialog. I also got a working CDockablePane in it. I can undock it and move it, but when I want to dock it the

Dynamically resizing CMFCPropertySheet with PropSheetLook_OneNoteTabs style

那年仲夏 提交于 2019-12-02 08:08:43
问题 I'm trying to resize dynamically a CMFCPropertySheet to add a custom control at the bottom of each page. As all Property Pages are not of the same height, I have a mechanism to increase the size if necessary. For this, I have overridden the OnActivatePage method and by using SetWindowPos , I can resize the sheet, first, then the tab control, then the page and finally I can move the OK/Cancel/Help buttons. It works fine with PropSheetLook_OutlookBar and PropSheetLook_Tabs styles but not with

MFC Feature Pack - How to add accelerators without deleting user's customization

时光怂恿深爱的人放手 提交于 2019-12-02 01:51:05
I want to add new accelerators to my MFC Feature Pack application. The problem is the app loads the accelerators already stored in the registry, thus disabling the new ones I've added. I know I could delete the Keyboard-# key in the registry, but that would delete any customization made to the accelerators by the user. Is there any way to add the new accelerators to the ones posibly defined by the users? 来源: https://stackoverflow.com/questions/6568610/mfc-feature-pack-how-to-add-accelerators-without-deleting-users-customization