CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3

Thread: View update

  1. #1
    Join Date
    May 1999
    Posts
    19

    View update

    I have created a toolbar in CMainFrame.
    Also I have Document/View system in my project.
    when i am hiding toolbar(which handler is in CMainFrame) i should update my View and I did a such thing in my CMainFrame(toolbar hiding handler):
    GetActiveView()->GetDocument()->UpdateAllViews(NULL, UPDATE_VIEW);


    BUT!?!?!?
    I have to check if Document is empty and has no views available else i can't call UpdateAllViews().
    don't know how????
    maybe to have some IsEmpty variable in CDocument, but not sure how can I access it...
    please give me some advice how to update my View after hiding toolbar or how to access CDocument public var from CMainFrame.
    Thanks alot


  2. #2
    Join Date
    May 1999
    Location
    Texas, USA
    Posts
    568

    Re: View update

    CDocument keeps a linked list of views. So you can call the function GetFirstViewPosition(). If this == NULL, then there are no views.

    Wayne



  3. #3
    Join Date
    May 1999
    Location
    Texas, USA
    Posts
    568

    Re: View update

    I just thought of something. Check out the function call UpdateAllViews() in the source code. I think it checks to see if any views are attached. If that is the case, then you don't need to worry about it.

    Wayne



Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured