一道程序题: 如何在MFC中的对话框按钮函数中获得CDocument指针从而对CDocument中数据进行操作
展开全部
MSDN上的例子:
//To get the first view in the list of views:
POSITION pos = GetFirstViewPosition();
CView* pFirstView = GetNextView( pos );
// This example uses CDocument::GetFirstViewPosition
// and GetNextView to repaint each view.
void CMyDoc::OnRepaintAllViews()
{
POSITION pos = GetFirstViewPosition();
while (pos != NULL)
{
CView* pView = GetNextView(pos);
pView->UpdateWindow();
}
}
// An easier way to accomplish the same result is to call
// UpdateAllViews(NULL);
主要是用什么API取指针!比如在Doc中取得View的指针
//To get the first view in the list of views:
POSITION pos = GetFirstViewPosition();
CView* pFirstView = GetNextView( pos );
// This example uses CDocument::GetFirstViewPosition
// and GetNextView to repaint each view.
void CMyDoc::OnRepaintAllViews()
{
POSITION pos = GetFirstViewPosition();
while (pos != NULL)
{
CView* pView = GetNextView(pos);
pView->UpdateWindow();
}
}
// An easier way to accomplish the same result is to call
// UpdateAllViews(NULL);
主要是用什么API取指针!比如在Doc中取得View的指针
来自:求助得到的回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询