• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 247
  • Last Modified:

Initialisation code for Document.


    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.

1 Solution
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.
pcssecureAuthor Commented:
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.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now