I am incorporating a MFC ribbon to an existing SingleDoc application. I get an assertion failure while calling the method LoadFrame()
on an object of type CMainFrame : public CFrameWndEx
CMainFrame* pFrame = new CMainFrame;
if (!pFrame)
return FALSE;
m_pMainWnd = pFrame;
// create and load the frame with its resources`
pFrame->LoadFrame(IDR_MAINFRAME, WS_OVERLAPPEDWINDOW | FWS_ADDTOTITLE, NULL, NULL);
The assertion is thrown in the function
CMFCRibbonCategory* CMFCRibbonBar::AddPrintPreviewCategory()
in the line
CString strLabel;
ENSURE(strLabel.LoadString(IDS_AFXBARRES_PRINT_PREVIEW));
the call stack(I have mentioned only the function calls here) is as follows -
CMFCRibbonBar::AddPrintPrevieCategory()
CMFCRibbonBar::RecalcLayout()
CMFCRibbonBar::LoadState(const char * lpszProfileName=0x06bdf2f8, int nIndex=59398, unsigned int uiID=4294967295)
DockingManager::LoadState(const char * lpszProfileName=0x06bdf2f8, unsigned int uiID=128)
CFrameImpl::LoadDockState(const char * lpszSectionName=0x06bdf2f8)
CFrameImpl::OnLoadFrame()
CFrameWndEx::LoadFrame(unsigned int nIDResource=128, unsigned long dwDefaultStyle=13598720, CWnd * pParentWnd=0x00000000, CCreateContext * pContext=0x00000000)
App::InitInstance() - Here in this function is where I call the Loadframe
Now, I am wondering how to go about this as all that I am doing is call the LoadFrame function.
Any help will be appreciated. Thanks.
.rc
and.rc2
files in the wizard implementation vs. your implementation and your implementation includes the ribbon bar stuff that the wizard implementation does? – ta.speot.isIDS_AFXBARRES_PRINT_PREVIEW
in the sample application too. I am guessing it is being generated during runtime. Let me know for any more pointers. Thanks. – Eternal Learner