Solved

Oncreate problem

Posted on 1998-05-21
3
309 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
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Perl Awk Need Help 3 109
notReplace  challenge 53 115
method notes when mouse over in eclipse 5 82
wordappend challenge 8 142
Introduction: Database storage, where is the exe actually on the disc? Playing a game selected randomly (how to generate random numbers).  Error trapping with try..catch to help the code run even if something goes wrong. Continuing from the seve…
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.
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

930 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