Solved

Oncreate problem

Posted on 1998-05-21
3
318 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 7

Accepted Solution

by:
galkin earned 80 total points
ID: 1313972
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
ID: 1313973
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
ID: 1313974
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

Percona Live Europe 2017 | Sep 25 - 27, 2017

The Percona Live Open Source Database Conference Europe 2017 is the premier event for the diverse and active European open source database community, as well as businesses that develop and use open source database software.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction: Hints for the grid button.  Nested classes, templated collections.  Squash that darned bug! Continuing from the sixth article about sudoku.   Open the project in visual studio. First we will finish with the SUD_SETVALUE messa…
In this post we will learn different types of Android Layout and some basics of an Android App.
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.
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…

635 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