Solved

Initialisation code for Document.

Posted on 2004-04-14
2
192 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
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

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
Best tools for Backup and restore of Wordpress site 6 55
isEverywhere  challenge 19 72
scoreUp challenge 14 57
how to split multiple lines delimiter : 8 80
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…
Introduction: The undo support, implementing a stack. Continuing from the eigth article about sudoku.   We need a mechanism to keep track of the digits entered so as to implement an undo mechanism.  This should be a ‘Last In First Out’ collec…
This Micro Tutorial hows how you can integrate  Mac OSX to a Windows Active Directory Domain. Apple has made it easy to allow users to bind their macs to a windows domain with relative ease. The following video show how to bind OSX Mavericks to …
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.

863 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

19 Experts available now in Live!

Get 1:1 Help Now