Click to See Complete Forum and Search --> : View update


rafiki
May 22nd, 1999, 05:05 PM
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

Wayne Fuller
May 22nd, 1999, 05:52 PM
CDocument keeps a linked list of views. So you can call the function GetFirstViewPosition(). If this == NULL, then there are no views.

Wayne

Wayne Fuller
May 22nd, 1999, 05:55 PM
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