本文整理汇总了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);
}
示例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;
}