Solved

OnInitialUpdate() calling...

Posted on 2000-02-28
2
770 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
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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Tab names are off by one 5 54
WinWaitActive parameters 12 31
Modbus - whats the maximum I can store in one register? 4 79
firstChar challenge 13 115
Introduction: Dialogs (1) modal - maintaining the database. Continuing from the ninth article about sudoku.   You might have heard of modal and modeless dialogs.  Here with this Sudoku application will we use one of each type: a modal dialog …
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 gives a high-level tour of the interface of Marketo (a marketing automation tool to help businesses track and engage prospective customers and drive them to purchase). You will see the main areas including Marketing Activities, Design …

772 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