Solved

Oncreate problem

Posted on 1998-05-21
3
307 Views
Last Modified: 2013-11-20
In the oncreate handler of my CMDIChild derived class I display a property sheet allowing the user to select options before the window is displayed. If the user selects cancel I exit the handler returning a -1. This prevents the window from being displayed but gives me the prompt. "Failed to create empty document". Is there any way to prevent this prompt. I am using the OpenDocumentFile (NULL) command to create the document view.
0
Comment
Question by:BlackRussian
  • 2
3 Comments
 
LVL 7

Accepted Solution

by:
galkin earned 80 total points
Comment Utility
This message in generated as a result to failure in call inside CMultiDocTemplate::OpenDocumentFile to CreateNewFrame, which in turn calls CMDIChildFrame::Create. OpenDocumentFile function is virtual so you should override it to prevent this message box from being displayed.
0
 

Author Comment

by:BlackRussian
Comment Utility
I'm am using Visual C++ ver 4.0 , CMultiDocTemplate doesn't show up as a deriveable class using class wizard. Can you explain how or show a code snippent ?.
0
 
LVL 7

Expert Comment

by:galkin
Comment Utility
Yuo need manually derive class from CMultiDocTemplate and override virtual OpenDocumentFile function. also don't forget to change reference from  CMultiDocTemplate to your document template class inside CWinApp::InitInstance
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Introduction: Displaying information on the statusbar.   Continuing from the third article about sudoku.   Open the project in visual studio. Status bar – let’s display the timestamp there.  We need to get the timestamp from the document s…
If you use Adobe Reader X it is possible you can't open OLE PDF documents in the standard. The reason is the 'save box mode' in adobe reader X. Many people think the protected Mode of adobe reader x is only to stop the write access. But this fe…
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.

771 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now