本文整理汇总了C++中CDocument::GetRuntimeClass方法的典型用法代码示例。如果您正苦于以下问题:C++ CDocument::GetRuntimeClass方法的具体用法?C++ CDocument::GetRuntimeClass怎么用?C++ CDocument::GetRuntimeClass使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CDocument
的用法示例。
在下文中一共展示了CDocument::GetRuntimeClass方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: ComputeProperties
BOOL COXChildFrameState::ComputeProperties(CFrameWnd* pFrameWnd)
{
ASSERT_VALID(this);
// Get the position of the frame window
::ZeroMemory(&m_framePlacement, sizeof(WINDOWPLACEMENT));
m_framePlacement.length = sizeof(WINDOWPLACEMENT);
if (pFrameWnd != NULL)
{
VERIFY(pFrameWnd->GetWindowPlacement(&m_framePlacement));
if(!pFrameWnd->IsWindowVisible())
{
m_framePlacement.showCmd=SW_HIDE;
}
}
// Get the document and view of this frame
CDocument* pDoc = NULL;
CView* pView = NULL;
if (!GetDocView(pFrameWnd, pDoc, pView))
{
TRACE0("COXChildFrameState::ComputeProperties : Failed to get the doc-view for this frame, failing\n");
return FALSE;
}
// Get the file path of the document
if (pDoc != NULL)
m_sDocPath = pDoc->GetPathName();
// Store the name of the classes of doc, frame and view
if (pDoc != NULL)
m_sDocClassName = pDoc->GetRuntimeClass()->m_lpszClassName;
if (pFrameWnd != NULL)
m_sFrameClassName = pFrameWnd->GetRuntimeClass()->m_lpszClassName;
if (pView != NULL)
m_sViewClassName = pView->GetRuntimeClass()->m_lpszClassName;
EmptySplitterPanes(m_pSplitterPanes);
if (m_bSaveSplitterPanes)
ComputeSplitterPanes(pFrameWnd);
ASSERT_VALID(this);
return TRUE;
}
示例2: TellScriptsToSave
void AppState::TellScriptsToSave()
{
if (_pApp && _fSaveScriptsBeforeRun)
{
POSITION posDocTemplate = _pApp->GetFirstDocTemplatePosition();
while (posDocTemplate)
{
CDocTemplate* pDocTemplate = _pApp->GetNextDocTemplate(posDocTemplate);
// get each document open in given document template
POSITION posDoc = pDocTemplate->GetFirstDocPosition();
while (posDoc)
{
CDocument* pDoc = pDocTemplate->GetNextDoc(posDoc);
if (pDoc->GetRuntimeClass() == RUNTIME_CLASS(CScriptDocument))
{
static_cast<CScriptDocument*>(pDoc)->SaveIfModified();
}
}
}
}
}