Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Initialisation code for Document.

Posted on 2004-04-14
2
Medium Priority
?
238 Views
Last Modified: 2013-11-20
Hi,

    In a document/view architecture, where can I call some initialisation code for the document object? I do not want to call document->Init() at its constructor. Init() is a self defined method.

Thanks.
0
Comment
Question by:pcssecure
[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 Comments
 
LVL 48

Accepted Solution

by:
AlexFM earned 500 total points
ID: 10830751
Take a look at virtual CDocument functions:

virtual BOOL OnNewDocument( );
virtual BOOL OnOpenDocument( LPCTSTR lpszPathName );

They may be used for initialization which is not done in the constructor.
0
 

Author Comment

by:pcssecure
ID: 10830771
But need the init code to run even without selecting new or open document on the menu.
Anyway, I managed to do it by calling init from the view object's oninitialupdate.

Problem solved.

Thanks.
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

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

In this article, I'll describe -- and show pictures of -- some of the significant additions that have been made available to programmers in the MFC Feature Pack for Visual C++ 2008.  These same feature are in the MFC libraries that come with Visual …
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…
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.
How to fix incompatible JVM issue while installing Eclipse While installing Eclipse in windows, got one error like above and unable to proceed with the installation. This video describes how to successfully install Eclipse. How to solve incompa…
Suggested Courses

636 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