本文整理汇总了C++中CChildFrame::GetDocument方法的典型用法代码示例。如果您正苦于以下问题:C++ CChildFrame::GetDocument方法的具体用法?C++ CChildFrame::GetDocument怎么用?C++ CChildFrame::GetDocument使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CChildFrame
的用法示例。
在下文中一共展示了CChildFrame::GetDocument方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: NewEx
IComparison* Comparisons::NewEx(LPCTSTR originalDocId, LPCTSTR modifiedDocId, VARIANT &renderingSet, LONG comparisonMode, VARIANT_BOOL showSelectorDialog, BSTR originalDescription, BSTR modifiedDescription)
{
AFX_MANAGE_STATE(AfxGetAppModuleState());
AutomationInteractionSuppressor ais;
CDeltaViewCommandLineInfo cmdInfo;
cmdInfo.m_sOriginal = EnsureDocId(originalDocId);
cmdInfo.m_sModified = EnsureDocId(modifiedDocId);
cmdInfo.m_sOriginalDisplayName = originalDescription;
cmdInfo.m_sModifiedDisplayName = modifiedDescription;
cmdInfo.m_bShowSelector = showSelectorDialog != VARIANT_FALSE;
CStdString selectedRenderingSet = RenderingSet::GetCurrentRenderingSet();
_variant_t vrenderSet = renderingSet;
if (vrenderSet.vt == VT_BSTR)
{
selectedRenderingSet = _bstr_t(vrenderSet);
}
RenderingSetOverride rso(selectedRenderingSet);
cmdInfo.m_comparisonOption = comparisonMode;
cmdInfo.m_bSilentMode = showSelectorDialog == VARIANT_FALSE;
COptionsDlgSelector optSelector;
if(optSelector.SetDlgInformation(cmdInfo) == S_FALSE)
return FALSE;
if( cmdInfo.ShouldShowDocumentSelectorDlg() )
{
if( !optSelector.ShowDialog() )
{
// Dialog might have returned false because it was cancelled during a right-click op.
// If so, don't display a 'unable to compare' error. ST2085
if( !optSelector.Cancelled() )
{
AfxThrowOleDispatchException(1105, L"Comparison failed.");
}
AfxThrowOleDispatchException(1106, L"Cancelled.");
}
}
else
{
if (!optSelector.StartComparisons())
{
AfxThrowOleDispatchException(1105, L"Comparison failed.");
}
}
// TODO - can we get the frame in a better way
CMDIFrameWnd* pMainFrame = DYNAMIC_DOWNCAST(CMDIFrameWnd, AfxGetMainWnd());
CChildFrame *pFrame = DYNAMIC_DOWNCAST( CChildFrame, pMainFrame->MDIGetActive() );
CDeltaVwDoc* pDoc = pFrame->GetDocument();
UpdateOpenList();
return FindComObject(pDoc);
}
示例2: Open
IComparison* Comparisons::Open(LPCTSTR wdfDocId)
{
AFX_MANAGE_STATE(AfxGetAppModuleState());
AutomationInteractionSuppressor ais;
CMDIFrameWnd* pMainFrame = DYNAMIC_DOWNCAST(CMDIFrameWnd, AfxGetMainWnd());
GetApp()->RealFileNew();
// TODO - can we get the frame in a better way
CChildFrame *pFrame = DYNAMIC_DOWNCAST( CChildFrame, pMainFrame->MDIGetActive() );
if (pFrame)
{
// TODO - do we need this
GetDVController(pFrame)->CloseDocument(true);
GetDVController(pFrame)->CloseDocument(false);
GetDVController(pFrame)->CloseCompositeDocument();
GetDVController(pFrame)->GetComparisonDocController().CloseComparisonDocument();
if( pFrame->GetCompositeBar() )
pFrame->GetCompositeBar()->OnInitialUpdate();
pFrame->ShowWindow(SW_SHOW);
pFrame->BringWindowToTop();
if (!GetDVController(pFrame)->LoadWDF(wdfDocId))
{
AfxThrowOleDispatchException(1102, L"File not found : " + CString(wdfDocId));
}
pFrame->GetDocument()->UpdateAllViews(NULL);
UpdateOpenList();
return FindComObject(pFrame->GetDocument());
}
AfxThrowOleDispatchException(1101, L"Internal Error");
return NULL;
}
示例3: OnUpdate
void CCompositeView::OnUpdate(CView* pSender, LPARAM lHint, CObject* pHint)
{
CChildFrame* pFrame = DYNAMIC_DOWNCAST( CChildFrame, GetParentFrame() );
if( !pFrame || !pFrame->IsWindowVisible() )
return;
if( !GetDVController() )
return;
// update the comparison doc detail sand frame
CString csTitleBarText;
CString csComparisonDoc = GetDVController()->GetComparisonDocController().GetComparisonDocumentTitle();
if (pFrame && !csComparisonDoc.IsEmpty())
{
// do not keep setting the title text to the same stuff as it forces the tabctrl to relayout and repaint
CString existingText;
pFrame->GetWindowText(existingText);
if (existingText != csComparisonDoc)
{
pFrame->GetDocument()->SetTitle(csComparisonDoc);
if (csComparisonDoc.GetLength()>40)
{
csComparisonDoc = csComparisonDoc.Left(32);
csComparisonDoc.TrimRight(L" ");
csComparisonDoc += L"...";
}
pFrame->SetWindowText(csComparisonDoc);
}
}
else
{
// do not keep setting the title text to the same stuff as it forces the tabctrl to relayout and repaint
CString existingText;
pFrame->GetWindowText(existingText);
if (existingText!= GetApplicationTitle())
pFrame->SetWindowText(GetApplicationTitle());
}
try
{
if (GetDocObject())
GetDocObject()->Repaint();
}
catch (...)
{
_ASSERTE(!_T("Catch ... How did we get here?"));
}
UpdateWindow();
}
示例4: UpdateOpenList
void Comparisons::UpdateOpenList()
{
CMainFrame* pMainFrame = DYNAMIC_DOWNCAST(CMainFrame, AfxGetMainWnd());
CWnd* pChild = pMainFrame->MDIGetActive();
while (pChild)
{
CChildFrame* pChildFrame = DYNAMIC_DOWNCAST(CChildFrame, pChild);
if (pChildFrame != NULL)
{
UpdateOpenDoc(pChildFrame->GetDocument());
}
pChild = pChild->GetWindow( GW_HWNDNEXT );
}
}