Solved

OnInitialUpdate() calling...

Posted on 2000-02-28
2
781 Views
Last Modified: 2013-11-20
I have a tree control view in my application that when a new file is loaded needs to be updated.

I have also overriden OnFileOpen() in my only document class to handle opening of a text format file I have.

Problem is this: If I open a file by double-clicking on that file in explorer *or* selecting that file from the Recently used files list on the File menu, everything gets updated correctly, becuase by doing these two methods, the views OnUpdate() function gets called twice and then the OnInitialUpdate() function gets called (which is where my code it to build the tree control).

However, when I use the File->Open which uses my OnFileOpen(), only OnUpdate() gets called in the view class, and thus the tree control doesn't get displayed properly. How can I get my one views OnInitialUpdate() to call after using OnFileOpen() in my document class?

I had to move the code from OnUpdate to OnInitialUpdate for other reasons..and I'd like to not have to put it back...

Thanks,

Tom
0
Comment
Question by:gunn
[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 8

Accepted Solution

by:
gelbert earned 100 total points
ID: 2566201
You need to call CDocument::SendInitialUpdate() to force OnInitialUpdate() to be called
0
 

Author Comment

by:gunn
ID: 2566247
Is this an "undocumented" function/feature? I couldn't find it in the help anywhere, but it compiled, linked and worked...thanks!
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Introduction: Dynamic window placements and drawing on a form, simple usage of windows registry as a storage place for information. Continuing from the first article about sudoku.  There we have designed the application and put a lot of user int…
Introduction: Displaying information on the statusbar.   Continuing from the third article about sudoku.   Open the project in visual studio. Status bar – let’s display the timestamp there.  We need to get the timestamp from the document s…
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.

749 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