mfc-feature-pack

CMFCToolbar layout not restored properly between sessions

回眸只為那壹抹淺笑 提交于 2019-12-22 08:36:41
问题 I'm having a problem with the CMFCToolbar class where the positions of the toolbars are not being restored properly between sessions. Here is a screen shot of how the toolbars are arranged before the app is closed: (source: achavis.net) Here is a screen shot of how the toolbars are restored when the app is launched again: (source: achavis.net) Notice the large gap that appears above the first toolbar and the second toolbar is now to the right of the main toolbar instead of beneath it. I was

How can I place a MFC CFormView inside a CDockablePane?

家住魔仙堡 提交于 2019-12-21 17:09:22
问题 How can I place a MFC CFormView inside a CDockablePane which was introduced in the VS 2008 MFC Feature Pack? 回答1: 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. 回答2: 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,

How to modify the tool rect of a CToolTipCtrl?

非 Y 不嫁゛ 提交于 2019-12-14 03:48:39
问题 This question is related to this one. In a CDockablePane derived class I have a CTreeCtrl member for which I add a ToolTip in OnCreate(): int CMyPane::OnCreate(LPCREATESTRUCT lpCreateStruct) { if (CDockablePane::OnCreate(lpCreateStruct) == -1) return -1; const DWORD dwStyle = WS_CHILD | WS_VISIBLE | WS_CLIPSIBLINGS | WS_CLIPCHILDREN | TVS_CHECKBOXES | TVS_DISABLEDRAGDROP | TVS_HASBUTTONS | TVS_HASLINES | TVS_LINESATROOT | TVS_INFOTIP | TVS_NOHSCROLL | TVS_SHOWSELALWAYS; if(!m_tree.Create

How do I display custom tooltips in a CTreeCtrl?

天涯浪子 提交于 2019-12-12 09:48:24
问题 I have a class derived from CTreeCtrl . In OnCreate() I replace the default CToolTipCtrl object with a custom one: int CMyTreeCtrl::OnCreate(LPCREATESTRUCT lpCreateStruct) { if (CTreeCtrl::OnCreate(lpCreateStruct) == -1) return -1; // Replace tool tip with our own which will // ask us for the text to display with a TTN_NEEDTEXT message CTooltipManager::CreateToolTip(m_pToolTip, this, AFX_TOOLTIP_TYPE_DEFAULT); m_pToolTip->AddTool(this, LPSTR_TEXTCALLBACK); SetToolTips(m_pToolTip); // Update:

MFC Ribbon: RemoveAllSubItems() in CView::OnUpdate leads to access violation (VS2008)

为君一笑 提交于 2019-12-11 18:25:49
问题 To reproduce the behavior, start a new MFC Outlook style project with Ribbon (CMyView as the view class name). Let's say I want to modify a menu of a CMFCRibbonButton , for example the subitems of the Print command, and for this, I want to RemoveAllSubItems() first. Add this as a public member in MainFrm.h: CMFCRibbonButton *m_pBtnPrint; Add this in the InitializeRibbon() member funcion in MainFrm.cpp: CMFCRibbonButton* pBtnPrint = new CMFCRibbonButton(ID_FILE_PRINT, strTemp, 6, 6); // store

MFC DockablePane not floating or hiding

老子叫甜甜 提交于 2019-12-11 14:14:12
问题 Is there any way to make a MFC DockablePane (from the new Feature Pack) that is docked in a window not able to float or to hide (and even disable the context menu that allows the user to select the states - dockable, float, hide etc.) What I basically want is to have 3 panes on a window that can change their horizontal dimensions, but not their position inside the window. Any suggestion? 回答1: The solution is to extend the CDockablePane and override in this class the following events: virtual

What does CMFCButton::EnableFullTextTooltip do?

纵然是瞬间 提交于 2019-12-11 07:12:44
问题 I was trying the CMFCButton tooltips and found that if I call EnableFullText() the tooltips don't show. Here's a little sample: // In OnInitDialog() c_MyBtn.m_nFlatStyle = CMFCButton::BUTTONSTYLE_SEMIFLAT; c_MyBtn.SetMouseCursorHand(); c_MyBtn.EnableFullTextTooltip(); c_MyBtn.SetTooltip(_T("Some string")); c_MyBtn.Invalidate(); So, does that function do something? The docs say it "Specifies whether to display the full text of a tooltip in a large tooltip window or a truncated version of the

VS2010, MFCEditBrowseControl heap crash

一个人想着一个人 提交于 2019-12-11 06:57:23
问题 I have a simple dialog that contains the new MFC browse edit control. The control was linked to 'CMFCEditBrowseCtrl m_edit' using the member variable wizard. The wizard generated mappings seem fine. On first run, the edit control is populated with chinese type characters or sometimes question marks, and then crashes either when the browse button is first pressed, or as soon as a file has been selected. The app crashes with a heap corruption failure. When I create a new test project and

Can you use CMFCVisualManager with a dialog based application?

白昼怎懂夜的黑 提交于 2019-12-10 16:47:51
问题 Can you use CMFCVisualManager with a dialog based application to change the applications appearance? If so how is it done? The idea is to change the shape, colour etc. of controls such as push buttons using the MFC Feature Pack released with MSVC 2008. 回答1: No, can't be done, at least not if you're talking about the Feature Pack version. Version 10 of the BCGSoft libraries do have this functionality, see for example: http://www.bcgsoft.com/bcgcontrolbarpro-versions.htm and http://www.bcgsoft