16,472
社区成员
发帖
与我相关
我的任务
分享
m_pView = new CMyView;
if (!m_pView->Create(NULL, NULL, AFX_WS_DEFAULT_VIEW, CRect(0,0,0,0), this, AFX_IDW_PANE_FIRST, NULL))
{
EndDialog(IDABORT);
}
CMyDoc* pDoc = new CMyDoc;//不需要DOC类,注释掉
pDoc->AddView(m_pView);//不需要DOC类,注释掉
m_pView->SendMessage(WM_INITIALUPDATE, 0, 0);
int CConnectScheduleFrame::OnCreate(LPCREATESTRUCT lpCreateStruct)
{
if (CDialogFrame::OnCreate(lpCreateStruct) == -1)
return -1;
// TODO: Add your specialized creation code here
CCreateContext ccc;
ccc.m_pNewViewClass = RUNTIME_CLASS( CConnect_Spy_View );
ccc.m_pCurrentDoc = NULL;
ccc.m_pNewDocTemplate = NULL;
ccc.m_pLastView = NULL;
ccc.m_pCurrentFrame = this;
// Because the CFRameWnd needs a window class, we will create
// a new one. I just copied the sample from MSDN Help.
// When using it in your project, you may keep CS_VREDRAW and
// CS_HREDRAW and then throw the other three parameters.
//CString strMyClass = AfxRegisterWndClass( CS_VREDRAW |
// CS_HREDRAW,
// ::LoadCursor( NULL, IDC_ARROW ),
// ( HBRUSH )::GetStockObject( WHITE_BRUSH ),
// ::LoadIcon( NULL, IDI_APPLICATION ) );
m_pView = ( CConnect_Spy_View * )( this->CreateView( &ccc ) );
::SendMessage( m_pView->GetSafeHwnd(), WM_INITIALUPDATE, 0, 0 );
this->SetActiveView( ( CView * )m_pView );
return 0;
}
int
CCommonScriptDialog::OnCreate(LPCREATESTRUCT lpCreateStruct)
{
if (CDialog::OnCreate(lpCreateStruct) == -1)
{
return -1;
}
// Because the CFRameWnd needs a window class, we will create
// a new one. I just copied the sample from MSDN Help.
// When using it in your project, you may keep CS_VREDRAW and
// CS_HREDRAW and then throw the other three parameters.
CString strMyClass = AfxRegisterWndClass( CS_VREDRAW |
CS_HREDRAW,
::LoadCursor( NULL, IDC_ARROW ),
( HBRUSH )::GetStockObject( WHITE_BRUSH ),
::LoadIcon( NULL, IDI_APPLICATION ) );
// Create the frame window with "this" as the parent
m_pFrame = new CCommonScriptFrame();
m_pFrame->SetID( IDR_TOOLBAR_COMMON_SCRIPT_CN, IDR_TOOLBAR_COMMON_SCRIPT_EN );
m_pFrame->Create( strMyClass, _T( "Common Script Tool View" ) , WS_CHILD,
CRect( 0, 0, 1, 1 ), this );
//m_pFrame->ShowWindow( SW_SHOW );
m_pFrame->MoveWindow( 0, 0, 300, 300 );
return 0;
}