Hi, i'm able to load the console at run time but it comes in a separate window.
I like to have this window inside my SDI project and skip the view, which a don't have any use for. I have split the may view into two, one is a FormView second remained the old. Now i want to have the console to be instead.
What I have tried:
#pragma comment(linker, "/entry:WinMainCRTStartup /subsystem:console")
BOOL CMainFrame::OnCreateClient(LPCREATESTRUCT lpcs, CCreateContext* pContext)
{
CRect cr;
GetWindowRect(&cr);
if (!m_mainSplitter.CreateStatic(this, 1, 2))
{
MessageBox("Error setting up m_mainSplitter", "ERROR", MB_OK | MB_ICONERROR);
return FALSE;
}
if (!m_mainSplitter.CreateView(0, 0, RUNTIME_CLASS(CINBToolView),
CSize(cr.Width() / 2, cr.Height()), pContext))
{
MessageBox("Error setting up splitter view", "ERROR", MB_OK | MB_ICONERROR);
return FALSE;
}
if (!m_mainSplitter.CreateView(0, 1, RUNTIME_CLASS(CSTART_SCREEN),
CSize(cr.Width() / 2, cr.Height()), pContext))
{
MessageBox("Error setting up splitter view", "ERROR", MB_OK | MB_ICONERROR);
return FALSE;
}
m_bInitSplitter = true;
return TRUE;
}
LRESULT CMainFrame::OnLoadNewForm(WPARAM wParam, LPARAM lParam)
{
CRect cr;
GetWindowRect(&cr);
AfxMessageBox("Called from MainFrame");
m_mainSplitter.ShowWindow(SW_HIDE);
m_mainSplitter.UpdateWindow();
m_mainSplitter.DeleteView(0,1);
if (!m_mainSplitter.CreateView(0, 1, RUNTIME_CLASS(CService),
CSize(cr.Width() / 2, cr.Height()), &m_Context))
{
MessageBox("Error setting up splitter view", "ERROR", MB_OK | MB_ICONERROR);
return FALSE;
}
return 0;
}