Improve company productivity with a Business Account.Sign Up

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 862
  • Last Modified:

OnInitialUpdate() calling...

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
gunn
Asked:
gunn
1 Solution
 
gelbertCommented:
You need to call CDocument::SendInitialUpdate() to force OnInitialUpdate() to be called
0
 
gunnAuthor Commented:
Is this an "undocumented" function/feature? I couldn't find it in the help anywhere, but it compiled, linked and worked...thanks!
0
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

Get your problem seen by more experts

Be seen. Boost your question’s priority for more expert views and faster solutions

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