void CMy2Doc::OnEditClearAll() //(.cpp)
{
// TODO: Add your command handler code here
DeleteContents();
UpdateAllViews(NULL);
}
就够了吧!! SetModifiedFlag(); 是?
{
// TODO: Add your command handler code here
DeleteContents();
UpdateAllViews(NULL);
}
就够了吧!! SetModifiedFlag(); 是?
void CMy2Doc::OnEditClearAll()
{
// TODO: Add your command handler code here
DeleteContents();
SetModifiedFlag();
UpdateAllViews(NULL);
AfxMessageBox("go");
}可以弹出一个对话框,但是为什么不能清除文档的内容呢?该如果更改?
是一个虚函数,需要你重载去实现你的工作!
void CMy2Doc::DeleteContents()
{
while (!m_strokeList.IsEmpty())
{
delete m_strokeList.RemoveHead();
}
CDocument::DeleteContents();
}
在.h中添加了CTypedPtrList<CObList,???> m_strokeList;
我把???改为CMy2Doc不起什么作用,应该怎么改才可以用?