Re: CFormView as Main View
It's possible, but I'm not sure what the point would be. You could always create a doc/view app but just not use the doc part of it. It won't to have a CDocument class in your project, and leaving it in is easier than trying to force it to work without it.
Re: CFormView as Main View
That's what I was suspecting. Was just hoping I could do it without document support because without registering the doc and calling on new wont the app fail on creation?
Re: CFormView as Main View
You could stop through the OnFileNew code and pull out the document stuff, but again, I don't see the point.
Re: CFormView as Main View
True. I just kept the document in added cs.style &= ~FWS_ADDTOTITLE; to precreatewindow and just ignored all other document calls except for the initial creation. I felt it was just easier just to create a blank WIN32 project and add my classes manually instead of using the predefined MFC wizard. Thanks for your feedback though.
Re: CFormView as Main View
Quote:
Originally Posted by
RobNHood
I felt it was just easier just to create a blank WIN32 project and add my classes manually instead of using the predefined MFC wizard.
It's rarely ever better to start from scratch when using MFC. Even if you could do it, you usually end up with code that is difficult to maintain (by experienced MFC folks) and often breaks the standard MFC IDE features like the class wizard.
Re: CFormView as Main View
I am a retired programmer (turning 50 next month) with VI for over 20 years. It has been a while however since I have had the need to work with Windows GUI since almost all of the programming I have done did not require GUI. So I am a bit rusty in that area but it is all coming back to me. I found it better to always work without the wizards. For MFC I just add #include <afxwin.h> and then set the program configuration to link with MFC and include the optional libs I require and add a rc file then any class is ready to be added via normal means. This always means less overhead, smaller compiled size and only the required includes you actually need. I am not a novice when it comes to programming I have been doing it since the days of DOS I do appreciate your input though and for most I am sure the wizards are fine. I just prefer more control.
Re: CFormView as Main View
Quote:
Originally Posted by
RobNHood
I am a retired programmer (turning 50 next month) with VI for over 20 years. It has been a while however since I have had the need to work with Windows GUI since almost all of the programming I have done did not require GUI. So I am a bit rusty in that area but it is all coming back to me. I found it better to always work without the wizards. For MFC I just add #include <afxwin.h> and then set the program configuration to link with MFC and include the optional libs I require and add a rc file then any class is ready to be added via normal means. This always means less overhead, smaller compiled size and only the required includes you actually need. I am not a novice when it comes to programming I have been doing it since the days of DOS I do appreciate your input though and for most I am sure the wizards are fine. I just prefer more control.
My experience is from the pain of taking over built from scratch MFC projects where nothing basically works. In this case, trying to add a new dialog or a view becomes a royal hassle because all the MFC plumbing is broken. Unfortunately, folks that start from scratch generally don't know what they've broken, because they don't use the wizards or the other features.
That being said, to each his own and that's the cool thing about programming: there are many ways of skinning the cat.
Re: CFormView as Main View
If you start with 0 files add add a stdafx.h with 1 line #include <afxwin.h>add a stdafx.cpp with #include "stdafx.h" then link to MFC as shared lib then the MFC Class wizard will work as usual with nothing broken that is all MFC actually requires to function. I have since added 6 dialogs, Propertysheets and pages for configuration, dockable panes, toolbars etc. all functional with no build errors. Just try the bare minimum as I pointed out and afterwards use the class wizard to add a CWinAppEx, CFrameWndEx, CView and CDocument and you will see it is much easier and more efficient than using MFCs wizard and templates.
Re: CFormView as Main View
I'm with Arjay on this one, which is why I suggested use the normal framework but ignore the document. It's going to work, and other programmers will understand it and know how to work with it.