Solved

Initialisation code for Document.

Posted on 2004-04-14
2
178 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
2 Comments
 
LVL 48

Accepted Solution

by:
AlexFM earned 250 total points
Comment Utility
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
Comment Utility
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

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

Here is how to use MFC's automatic Radio Button handling in your dialog boxes and forms.  Beginner programmers usually start with a OnClick handler for each radio button and that's just not the right way to go.  MFC has a very cool system for handli…
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.
This tutorial demonstrates a quick way of adding group price to multiple Magento products.

743 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

13 Experts available now in Live!

Get 1:1 Help Now