I have a strange Problem with my MFC Application which i create with visual Studio 2015.
If i run the Application inside Visual Studio via Local Windows Debugger everything works as expected.
If i start the generated .exe File outside of Visual Studio the Toolbar and the Statusbar are not displayed in the Mainframe. I couldn't activate them via View Menu. So my application crashs when I use a Menu Point which writes text to the statusbar.
Did someone now whats the Problem??
Perhaps I didn't know which code i should display in the question feel free to ask for specific code sections in the comments. I will edit the question and provide the code.
This is the code in which the Tool- and Statusbar are created.
int CMainFrame::OnCreate(LPCREATESTRUCT lpCreateStruct)
{
if (CFrameWnd::OnCreate(lpCreateStruct) == -1)
return -1;
if (!m_wndToolBar.CreateEx(this, TBSTYLE_FLAT, WS_CHILD | WS_VISIBLE | CBRS_TOP | CBRS_TOOLTIPS | CBRS_FLYBY | CBRS_SIZE_DYNAMIC) ||
!m_wndToolBar.LoadToolBar(IDR_MAINFRAME))
{
//TRACE0("Failed to create toolbar\n");
return -1; // fail to create
}
m_wndToolBar.LoadTCToolBar(16, IDB_TOOLICONS, IDB_TOOLICONS_HOT, IDB_TOOLICONS_DISABLED, RGB(255, 0, 255));
if (!m_wndStatusBar.Create(this))
{
//TRACE0("Failed to create status bar\n");
return -1; // fail to create
}
m_wndStatusBar.SetIndicators(indicators, sizeof(indicators) / sizeof(UINT));
return 0;
}