Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

OnInitialUpdate() calling...

Posted on 2000-02-28
2
Medium Priority
?
819 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 400 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

Important Lessons on Recovering from Petya

In their most recent webinar, Skyport Systems explores ways to isolate and protect critical databases to keep the core of your company safe from harm.

Question has a verified solution.

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

This is to be the first in a series of articles demonstrating the development of a complete windows based application using the MFC classes.  I’ll try to keep each article focused on one (or a couple) of the tasks that one may meet.   Introductio…
Introduction: Database storage, where is the exe actually on the disc? Playing a game selected randomly (how to generate random numbers).  Error trapping with try..catch to help the code run even if something goes wrong. Continuing from the seve…
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.
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …

721 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