您的位置:首页 > 其它

CView::OnInitialUpdate的MSDN译文

2007-06-17 09:32 267 查看
Called by the framework after the view is first attached to the document, but before the view is initially displayed. The default implementation of this function calls the OnUpdate member function with no hint information (that is, using the default values of 0 for the lHint parameter and NULL for the pHint parameter). Override this function to perform any one-time initialization that requires information about the document. For example, if your application has fixed-sized documents, you can use this function to initialize a view’s scrolling limits based on the document size. If your application supports variable-sized documents, use OnUpdate to update the scrolling limits every time the document changes.

[b]virtual void OnInitialUpdate( );[/b]

在框架完全建立后(视类和文档类绑定在一起),但又在视图被显示之前由框架调用。默认操作是调用虚函数OnUpdate ,该函数中的hint信息由系统设置为:lHint=0, pHint=NULL。基于文档的信息重写这个函数完成一次性的初始化工作。例如,你的应用程序是固定大小的文档,你可以利用这个函数设置视图的滚动限制。如果你的程序支持大小可变的文档,就可以在文档每次发生变化的时候通过调用函数OnUpdate来更新滚动限制。
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: