Answered by:
Mfc feature pack CMFCOutlookBar not showing

Question
-
Hello everybody: I'm developing a SDI project with MFC 2010 using the 'new' MFC feature pack to add some stuffs.
The template added me the Calendar bar and Tree bar, pretty unuseful to my application. I removed some of them and replaced one with a CDialogEx derived class and everything works fine.
Now, I want to definitely remove all of old template panel and use mines, but as soon as I remove the code commenting it, the whole control will not show anymore.
Worst part, if I decomment the control still not show. Sometimes, removing the registry key associated will let the control show for just one run.
///////////////////////////////////////////> .H File class CMainFrame : public CFrameWndEx { DECLARE_DYNCREATE(CMainFrame) DECLARE_MESSAGE_MAP() protected: CCalendarBar m_wndCalendar; //> Old pane CEliCUTP140PannelloDlg* m_pPannelloDlg; //> Derived from CDialogEx CMFCMenuBar m_wndMenuBar; CMFCOutlookBar m_wndBarraPannelli; //> Outlook bar CMFCOutlookBarPane* m_pCurrOutlookPage; //> Dunno what's for CMFCOutlookBarTabCtrl* m_pCurrOutlookWnd; //> Same as above CMFCShellTreeCtrl m_wndTree; //> Old pane CMFCStatusBar m_wndStatusBar; CMFCToolBar m_wndToolBar; CMFCToolBarImages m_UserImages; //////////////////////////////////////////> .CPP file. m_wndBarraPannelli.SetMode2003(); if (strTemp.LoadString(theApp.m_hRisorse, IDS_SHORTCUTS) == FALSE) { m_Log.AddString(_T("CMainFrame::CreateOutlookBar - Impossibile caricare la stringa IDS_SHORTCUTS.")); throw CGUIException(E_GE_IMP_CAR_STR); } dwOpzioni = WS_CHILD | WS_VISIBLE | CBRS_LEFT; if (m_wndBarraPannelli.Create(strTemp, this, CRect(0, 0, nInitialWidth, 32000), uiID, dwOpzioni, AFX_CBRS_OUTLOOK_TABS) == FALSE) return FALSE; dwStyle = AFX_CBRS_FLOAT | AFX_CBRS_AUTOHIDE | AFX_CBRS_RESIZE; dwOpzioni = CBRS_TOOLTIPS | CBRS_FLYBY | CBRS_SIZE_DYNAMIC; m_wndBarraPannelli.SetPaneStyle(m_wndBarraPannelli.GetPaneStyle() | dwOpzioni); m_wndBarraPannelli.SetButtonsFont(&afxGlobalData.fontBold); pOutlookBar = (CMFCOutlookBarTabCtrl *)m_wndBarraPannelli.GetUnderlyingWindow(); if (pOutlookBar == NULL) return FALSE; pOutlookBar->EnableInPlaceEdit(FALSE); pOutlookBar->EnableAnimation(TRUE); pOutlookBar->EnableScrollButtons(); pOutlookBar->SetBorderSize(1); pOutlookBar->SetPageButtonTextAlign(TA_LEFT); /* the last panel which I'm trying to remove const DWORD dwTreeStyle = WS_CHILD | WS_VISIBLE | TVS_HASLINES | TVS_LINESATROOT | TVS_HASBUTTONS; tree.Create(dwTreeStyle, rectDummy, pOutlookBar, 1200); if (strTemp.LoadString(theApp.m_hRisorse, IDS_FOLDERS) == FALSE) { m_Log.AddString(_T("CMainFrame::CreateOutlookBar - Impossibile caricare la stringa IDS_FOLDERS.")); throw CGUIException(E_GE_IMP_CAR_STR); } pOutlookBar->AddControl(&tree, strTemp, 2, TRUE, dwStyle);**/ if (m_pPannelloDlg == NULL) m_pPannelloDlg = new CEliCUTP140PannelloDlg(); m_pPannelloDlg->m_pSuperParent = this; bNameValid = m_pPannelloDlg->Create(IDD_ELICUTP140PANNELLODLG, &m_wndBarraPannelli); m_pPannelloDlg->ShowWindow(SW_SHOW); if (strTemp.LoadString(theApp.m_hRisorse, IDS_PAN_MOV) == FALSE) { m_Log.AddString(_T("CMainFrame::CreateOutlookBar - Impossibile caricare la stringa IDS_PAN_MOV.")); throw CGUIException(E_GE_IMP_CAR_STR); } pOutlookBar->AddControl(m_pPannelloDlg, strTemp, 0, TRUE, dwStyle); m_wndBarraPannelli.ShowWindow(SW_SHOW); pOutlookBar->SetImageList(theApp.m_bHiColorIcons ? IDB_PAGES_HC : IDB_PAGES, 24); pOutlookBar->SetToolbarImageList(theApp.m_bHiColorIcons ? IDB_PAGES_SMALL_HC : IDB_PAGES_SMALL, 16); pOutlookBar->RecalcLayout(); bAnimation = theApp.GetInt(_T("OutlookAnimation"), TRUE); CMFCOutlookBarTabCtrl::EnableAnimation(bAnimation);
If I should paste extra code let me know. Any help appreciated.Tuesday, February 23, 2016 1:27 PM
Answers
-
Hi,
I have tested your code. I can reproduce your issue. When you compiled for the first time on my computer. I can see the tree bar. But when recompiled I can’t see the tree bar. The attachment is a result of my test on vs2015 update 1. I also debug your code but the CCalendarBar can’t be created and displayed.
>> if I decomment the control still not show. Sometimes, removing the registry key associated will let the control show for just one run
According to your description. I think this is issue. You can go to connect to post the issue.
Best Regards,
Hart
- Proposed as answer by Hart Wang Thursday, March 3, 2016 3:19 AM
- Marked as answer by May Wang - MSFT Friday, March 4, 2016 3:33 AM
Thursday, February 25, 2016 8:20 AM
All replies
-
Hi,
When the whole control will not show, are you try to debug your program? Do you have any error information?
According to your description. It is hard to find any useful information to solve the issue. So could you please provide a demo for us to test.
Best Regards,
Hart
Wednesday, February 24, 2016 1:58 AM -
Well, it's kinda hard to provide a demo test, because the program moves a machine and it strictly needs hardware stuff to work. Anyway: I'm not receiving any error or I don't know where to look for them, return values are OK and yes, I'm debugging.
IssamTP
EDIT: I'll post a miniproject as .zip where I'm doing the same operation in the afternoon local time.
- Edited by IssamTP Wednesday, February 24, 2016 9:26 AM
Wednesday, February 24, 2016 7:49 AM -
Hi,
Could you please try to create a new project with this content? If you do. We need to check whether we can reproduce the problem? I think this problem is a special case.
For the better support , Could you please provide a demo for us to test.
Best Regards,
Hart
Wednesday, February 24, 2016 9:52 AM -
Hi, I've done the empty project reproducing the error, but I don't know where to upload it for your use.
In the afternoon I'll upload it on my server and I'll post the link.
IssamTP
EDIT: I've uploaded the demo project at this location. Hope you can download and test it.
- Edited by IssamTP Wednesday, February 24, 2016 1:21 PM Added link to demo project
Wednesday, February 24, 2016 9:57 AM -
Hi,
I have tested your code. I can reproduce your issue. When you compiled for the first time on my computer. I can see the tree bar. But when recompiled I can’t see the tree bar. The attachment is a result of my test on vs2015 update 1. I also debug your code but the CCalendarBar can’t be created and displayed.
>> if I decomment the control still not show. Sometimes, removing the registry key associated will let the control show for just one run
According to your description. I think this is issue. You can go to connect to post the issue.
Best Regards,
Hart
- Proposed as answer by Hart Wang Thursday, March 3, 2016 3:19 AM
- Marked as answer by May Wang - MSFT Friday, March 4, 2016 3:33 AM
Thursday, February 25, 2016 8:20 AM -
Hi,
I have tested your code. I can reproduce your issue. When you compiled for the first time on my computer. I can see the tree bar. But when recompiled I can’t see the tree bar. The attachment is a result of my test on vs2015 update 1. I also debug your code but the CCalendarBar can’t be created and displayed.
>> if I decomment the control still not show. Sometimes, removing the registry key associated will let the control show for just one run
According to your description. I think this is issue. You can go to connect to post the issue.
Best Regards,
Hart
Excuse me: do you mean that this is a bug and I have to report it to Microsoft?IssamTP
Thursday, February 25, 2016 8:32 AM -
Hi,
Yes . I can reproduce your issue.
When we compiled for the first time on my computer. I can see the tree bar. But when recompiled I can’t see the tree bar Best Regards,
Hart
Thursday, February 25, 2016 9:44 AM