如何在Dialog显示 Frame/view?或在Dialog中添加View?
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时是显示时出错.不知道是什么原因?