int CTestFrame::OnCreate(LPCREATESTRUCT lpCreateStruct)
{
if (CFrameWnd::OnCreate(lpCreateStruct) == -1)
return -1; CCreateContext context;
context.m_pNewViewClass = RUNTIME_CLASS(CEditClient);
context.m_pCurrentFrame = this;
context.m_pCurrentDoc = NULL;
context.m_pLastView = NULL; m_pView = STATIC_DOWNCAST(CEditClient, CreateView(&context)); //CreateView(&context);
if(m_pView != NULL)
{
m_pView->ShowWindow(SW_SHOW);
SetActiveView(m_pView);
} //ShowWindow(SW_MAXIMIZE); */ return 0;
}
不管我是在Dialog中动态创建一个View还是显示一个Frame/view,程序都会报错,在Dialog中动态创建一个View的时候是有鼠标Click时出错,创建Frame/view时是显示时出错.不知道是什么原因?
{
if (CFrameWnd::OnCreate(lpCreateStruct) == -1)
return -1; CCreateContext context;
context.m_pNewViewClass = RUNTIME_CLASS(CEditClient);
context.m_pCurrentFrame = this;
context.m_pCurrentDoc = NULL;
context.m_pLastView = NULL; m_pView = STATIC_DOWNCAST(CEditClient, CreateView(&context)); //CreateView(&context);
if(m_pView != NULL)
{
m_pView->ShowWindow(SW_SHOW);
SetActiveView(m_pView);
} //ShowWindow(SW_MAXIMIZE); */ return 0;
}
不管我是在Dialog中动态创建一个View还是显示一个Frame/view,程序都会报错,在Dialog中动态创建一个View的时候是有鼠标Click时出错,创建Frame/view时是显示时出错.不知道是什么原因?
http://www.codeguru.com/Cpp/W-D/dislog/article.php/c5009/
thanks,调试通过的话马上给分
Creating a View on a Dialog - Naama Goraly (2001/08/09)
Creating a view on a child frame is a basic action when programming in MFC, but what happens when you want your view to be attached to a popup dialog? This article shows a simple way to make this possible.
http://codeguru.earthweb.com/dialog/vwindlg.html
Creating a View in Dialog (An easy way). - Z Mohamed Mustafa (2002/02/19)
Adding a view to a dialog.
http://www.vccode.com/file_show.php?id=782