I have created a program using mfc wizard in visual c++ 6 and chose the multiple-document option but now want to change it so it's only a single-document application. Do you know how to do this?
I have created a program using mfc wizard in visual c++ 6 and chose the multiple-document option but now want to change it so it's only a single-document application. Do you know how to do this?
Ok this isn't really a big help but the only way I have been able to do it is to use the appwizard to create a new SDI.Recreate all classes..etc, and then start to copy & paste all your user created code from the MDI. Not very graciuos but it works.
~Barjor
I looked this up in the help files before and that is how it instructed to do it. Here are the main differences that I can remember from an SDI and a MDI app..
CMainFrame is derived from CMainWnd --- change to this in CMainFrm.h
CMainFrame is derived from CMDIWnd
Lose the CChildFrame.cpp and CChildFrame.h files
lose the #include "ChildFrame.h" in the C..App.h
in the C..App.cpp modify the InitInstance function
declare a CSingleDocTemplate instead of a CMultiDocTemplate
Delete the code segment that creates the MDI Frame Window
// create main MDI Frame window
CMainFrame* pMainFrame = new CMainFrame;
if (!pMainFrame->LoadFrame(IDR_MAINFRAME))
return FALSE;
m_pMainWnd = pMainFrame;
You can expect to run into some errors but you should be able to do it the way barjor said.
zMan