I use just one menu IDR_FINALTTYPE.
why the view i use "CreateDocTab()" to create has the print and print preview ,but the view i use CreateDocTxt() to create does not have?
Originally posted by sstofka
I don't see where you have called AddDocTemplate() after you have declared your text template in InitInstance(). That may be the problem.
Also, your member tab template looks exactly like the first pDocTemplate. Why have both?
Steve
I did not call AddDocTemplate() because I think it is useless to do so.To Add Document Templates to CDocManager,what is the use of CDocManager?
By the way,I have take this problem out from my "big" project.
If CTextView does not have OnFilePrint, and the other printing handlers and virtual functions, just copy them from CFinalTView, and change the code appropriately.
If you't call AddDocTemplate() in your InitInstance on the the member template pointers, then the app will not delete memory for the pointers as the app closes, so remember to free memory in the app's ExitInstance()
Originally posted by sstofka
If CTextView does not have OnFilePrint, and the other printing handlers and virtual functions, just copy them from CFinalTView, and change the code appropriately.
If you't call AddDocTemplate() in your InitInstance on the the member template pointers, then the app will not delete memory for the pointers as the app closes, so remember to free memory in the app's ExitInstance()
To Add Document Templates to CDocManager,what is the use of CDocManager?
CDocManager handles the list of document templates, and they in turn handle the list of open documents/views. You do need to register your document types with it as without doing so, you break some of the standard functionality of MFC, such as CloseAllDocuments(), GetOpenDocumentCount(), SaveAllModified() etc.
Lets say you have 3 documents open all of which are modified, if you hit the close app button, you will not be asked to save your work, and the mainframe may well try and close with open documents present.
Please use meaningful question titles - "Help me" does not let me know whether I can help with your question, and I am unlikely to bother reading it. Please remember to rate useful answers. It lets us know when a question has been answered.
* The Best Reasons to Target Windows 8
Learn some of the best reasons why you should seriously consider bringing your Android mobile development expertise to bear on the Windows 8 platform.