?
Solved

Oncreate problem

Posted on 1998-05-21
3
Medium Priority
?
320 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 240 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

Will your db performance match your db growth?

In Percona’s white paper “Performance at Scale: Keeping Your Database on Its Toes,” we take a high-level approach to what you need to think about when planning for database scalability.

Question has a verified solution.

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

This is to be the first in a series of articles demonstrating the development of a complete windows based application using the MFC classes.  I’ll try to keep each article focused on one (or a couple) of the tasks that one may meet.   Introductio…
Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.
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…
Suggested Courses

719 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