Solved

Initialisation code for Document.

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

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
mixString challenge 36 131
Installing Microsoft R server on REDHAT or SUSE Linux 4 147
Shell script to login to remote m/c and execute commands 10 78
matchUp  challenge 9 115
Introduction: Dialogs (2) modeless dialog and a worker thread.  Handling data shared between threads.  Recursive functions. Continuing from the tenth article about sudoku.   Last article we worked with a modal dialog to help maintain informat…
Have you tried to learn about Unicode, UTF-8, and multibyte text encoding and all the articles are just too "academic" or too technical? This article aims to make the whole topic easy for just about anyone to understand.
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.
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…

809 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