Go Premium for a chance to win a PS4. Enter to Win

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

CFormView displays too slow

I have an MDI app that contains a CFormView for its view.  This view contains many controls that are initialized when the document is opened.

When a new document is opened and initialize during application startup, it reasonably displays the view.  However everytime I create a new document from then on, it dipslays a few controls and the outline of the child frame and then finally the entire view.

How can I get this to display "all at the same time" instead of this piecemeal behavior?

Thanks.
0
solomon021499
Asked:
solomon021499
  • 2
1 Solution
 
psdavisCommented:
How about trying the SetRedraw function?

The format is CWnd::SetRedraw( bool bRedraw )

This member function sets or clears the redraw flag. While the redraw flag is cleared, the contents will not be updated after each change and will not be repainted until the redraw flag is set. For example, an application that needs to add several items to a list box can clear the redraw flag, add the items, and then set the redraw flag. Finally, the application can call the Invalidate or InvalidateRect member function to cause the list box to be repainted.

Phillip
0
 
solomon021499Author Commented:
The child frame of the view still displays much sooner than
the controls (although the controls all display simultaneously now).  Where does this Redraw go to get the frame and the entire view to display all at once?
0
 
psdavisCommented:
I don't know that one.  You might try overriding the child frame's on draw as well.

Then again, you might consider just displaying a 'please wait' in the background of the child frame so that the user isn't curious what's going on.  Displaying the frame and then displaying the view isn't all that bad compared to someone pressing the button and nothing happening for a few seconds.

Phillip
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

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