May 11th, 2011, 03:33 AM
CMFCOutlookbar crash while adding tab
I need to add CMFCOutlookbar control in my application. I used MSDN help and successfully able to add this control in the new applications in VS2008. But when i tried the same in my existing application, its giving crash while adding tabs.
Here is the code :
BOOL flag = m_wndOutlookBar.Create (_T("Shortcuts"), this, CRect (0, 0, 100, 200), ID_VIEW_NAVIGATION, WS_CHILD | WS_VISIBLE | CBRS_LEFT);
CMFCOutlookBarTabCtrl* pOutlookBar = (CMFCOutlookBarTabCtrl*) m_wndOutlookBar.GetUnderlyingWindow ();
flag = m_wndOutlookPane.Create (&m_wndOutlookBar, AFX_DEFAULT_TOOLBAR_STYLE, IDS_OUTLOOKBAR, AFX_CBRS_FLOAT | AFX_CBRS_RESIZE);
// make the Outlook pane detachable (enable docking)
flag = m_wndOutlookPane.AddButton (IDR_MAINFRAME, _T("Open"), ID_FILE_OPEN);
flag = pOutlookBar->IsMode2003();
pOutlookBar->AddTab (&m_wndOutlookPane, _T("Normal"), (UINT) -1, TRUE); //Giving crash at this line
pOutlookBar->AddTab (&m_wndOutlookPane, _T("Kernel"), (UINT) -1, TRUE);
It would be very helpful if anybody gives me directions to fix this problem.
Thanks in advance !!
Tags for this Thread
Click Here to Expand Forum to Full Width
This is a CodeGuru survey question.