当前位置: 首页>>代码示例>>C++>>正文


C++ CChildFrame::LoadFrame方法代码示例

本文整理汇总了C++中CChildFrame::LoadFrame方法的典型用法代码示例。如果您正苦于以下问题:C++ CChildFrame::LoadFrame方法的具体用法?C++ CChildFrame::LoadFrame怎么用?C++ CChildFrame::LoadFrame使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在CChildFrame的用法示例。


在下文中一共展示了CChildFrame::LoadFrame方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: OnFileNew

void CMainFrame::OnFileNew() 
{
	BOOL bMaximized = FALSE;
	// creates a new child window, maximized if active child is maximized
	CChildFrame* pActiveChild = (CChildFrame*) MDIGetActive(&bMaximized);
	CChildFrame* pChild = new CChildFrame();
	pChild->LoadFrame(IDR_EX22CTYPE,
		WS_CHILD | WS_VISIBLE | WS_OVERLAPPEDWINDOW |
		(bMaximized ? WS_MAXIMIZE : 0), this);

	CString strTitle;
	strTitle.Format("Child Window %d", m_nChild++);
	pChild->SetWindowText(strTitle);
}
开发者ID:jiayuehua,项目名称:InsideVC,代码行数:14,代码来源:MainFrm.cpp

示例2: CreateNewFrame

CChildFrame* CChildFrame::CreateNewFrame( CStaticDoc* pStaticDoc )
{
	if (pStaticDoc != NULL)
		ASSERT_VALID(pStaticDoc);
	// create a frame wired to the specified document

	ASSERT( pStaticDoc->GetIDResource() != 0); // must have a resource ID to load from
	CCreateContext context;
	context.m_pCurrentFrame = NULL;
	context.m_pCurrentDoc = NULL;		//pStaticDoc;
	context.m_pLastView = NULL;
	context.m_pNewViewClass = NULL; // pViewClass if this is set, a view will be created!
	context.m_pNewDocTemplate = NULL;

	CRuntimeClass* pFrameClass = RUNTIME_CLASS(CChildFrame);

	CChildFrame * pFrame = (CChildFrame*)pFrameClass->CreateObject();
	if (pFrame == NULL)
	{
		TRACE1("Warning: Dynamic create of frame %hs failed.\n",
			pFrameClass->m_lpszClassName);
		return NULL;
	}
	ASSERT_KINDOF(CChildFrame, pFrame);

	// create new from resource
	if (!pFrame->LoadFrame( pStaticDoc->GetIDResource(),
			WS_OVERLAPPEDWINDOW | FWS_ADDTOTITLE,   // default frame styles
			AfxGetMainFrame(), &context))
	{
		TRACE0("Warning: Couldn't create a child frame.\n");
		// frame will be deleted in PostNcDestroy cleanup
		return NULL;
	}

	// it worked !
	return pFrame;
}
开发者ID:darwinbeing,项目名称:trade,代码行数:38,代码来源:ChildFrm.cpp


注:本文中的CChildFrame::LoadFrame方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。