本文整理汇总了C++中CDocTemplate::GetNextDoc方法的典型用法代码示例。如果您正苦于以下问题:C++ CDocTemplate::GetNextDoc方法的具体用法?C++ CDocTemplate::GetNextDoc怎么用?C++ CDocTemplate::GetNextDoc使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CDocTemplate
的用法示例。
在下文中一共展示了CDocTemplate::GetNextDoc方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: OnWorkOffline
void CMainFrame::OnWorkOffline()
{
CBCGPIE7DemoView::m_bWorkOffline = !CBCGPIE7DemoView::m_bWorkOffline;
POSITION posTemplate = theApp.m_pDocManager->GetFirstDocTemplatePosition ();
while (posTemplate != NULL)
{
CDocTemplate* pTemplate = theApp.m_pDocManager->GetNextDocTemplate (posTemplate);
if (pTemplate != NULL)
{
POSITION posDocument = pTemplate->GetFirstDocPosition ();
while (posDocument != NULL)
{
CDocument* pDocument = pTemplate->GetNextDoc (posDocument);
if (pDocument != NULL)
{
POSITION posView = pDocument->GetFirstViewPosition ();
while (posView != NULL)
{
CHtmlView* pView = DYNAMIC_DOWNCAST(CHtmlView, pDocument->GetNextView (posView));
if (pView != NULL)
{
pView->SetOffline (CBCGPIE7DemoView::m_bWorkOffline);
}
}
}
}
}
}
}
示例2: OnViewDeletedrecords
void CMainFrame::OnViewDeletedrecords()
{
m_bShowDeletedRecords = !m_bShowDeletedRecords;
CWinApp* pApp = AfxGetApp();
ASSERT_VALID(pApp);
// Iterate through the application's document templates list
POSITION posTemplate = pApp->GetFirstDocTemplatePosition();
while(posTemplate)
{
// For each document template object...
CDocTemplate* pTemplate = pApp->GetNextDocTemplate(posTemplate);
ASSERT_VALID(pTemplate);
ASSERT_KINDOF(CDocTemplate, pTemplate);
// Iterate through the template's document list
POSITION posDocument = pTemplate->GetFirstDocPosition();
while(posDocument)
{
// For each document object...
CDocument* pDoc = pTemplate->GetNextDoc(posDocument);
ASSERT_VALID(pDoc);
ASSERT_KINDOF(CDocument, pDoc);
// reload records
POSITION pos = pDoc->GetFirstViewPosition();
while (pos)
((CDBFExplorerView *)pDoc->GetNextView(pos))->ShowRecords(m_bShowDeletedRecords);
}
}
}
示例3: RestoreDeviceObjects
HRESULT CDxtexApp::RestoreDeviceObjects(VOID)
{
// Tell each view of each doc to restore
POSITION pos = GetFirstDocTemplatePosition();
CDocTemplate* pDocTemplate = GetNextDocTemplate( pos );
pos = pDocTemplate->GetFirstDocPosition();
for( ; ; )
{
CDocument* pDoc = NULL;
if( pos == NULL )
break;
pDoc = pDocTemplate->GetNextDoc( pos );
if( pDoc == NULL )
break;
POSITION posView;
CDxtexView* pView = NULL;
posView = pDoc->GetFirstViewPosition();
for( ; ; )
{
if( posView == NULL )
break;
pView = (CDxtexView*)pDoc->GetNextView( posView );
if( pView == NULL )
break;
pView->RestoreDeviceObjects();
}
}
return S_OK;
}
示例4: SetConfig
void CMainFrame::SetConfig(SDComCfg *sDComCfg)
{
POSITION appPos, templatePos;
CDocTemplate *pTemplate;
CDComDoc *pDoc;
appPos = AfxGetApp()->GetFirstDocTemplatePosition();
while (appPos)
{
pTemplate = AfxGetApp()->GetNextDocTemplate(appPos);
if (pTemplate)
{
templatePos = pTemplate->GetFirstDocPosition();
while (templatePos)
{
pDoc = (CDComDoc*)pTemplate->GetNextDoc(templatePos);
if (pDoc)
{
pDoc->SetConfig(sDComCfg);
}
}
}
}
}
示例5: InvalidateAll
void CMainFrame::InvalidateAll()
{
POSITION appPos, templatePos;
CDocTemplate *pTemplate;
CDComDoc *pDoc;
CDComView *pView;
appPos = AfxGetApp()->GetFirstDocTemplatePosition();
while (appPos)
{
pTemplate = AfxGetApp()->GetNextDocTemplate(appPos);
if (pTemplate)
{
templatePos = pTemplate->GetFirstDocPosition();
while (templatePos)
{
pDoc = (CDComDoc*)pTemplate->GetNextDoc(templatePos);
if (pDoc)
{
pView = pDoc->GetView();
if (pView)
{
pView->PostMessage(WM_DOC_UPDATE, 0);
pView->Invalidate();
}
}
}
}
}
}
示例6: FindTextResetAll
void CMainFrame::FindTextResetAll()
{
POSITION appPos, templatePos;
CDocTemplate *pTemplate;
CDComDoc *pDoc;
appPos = AfxGetApp()->GetFirstDocTemplatePosition();
while (appPos)
{
pTemplate = AfxGetApp()->GetNextDocTemplate(appPos);
if (pTemplate)
{
templatePos = pTemplate->GetFirstDocPosition();
while (templatePos)
{
pDoc = (CDComDoc*)pTemplate->GetNextDoc(templatePos);
if (pDoc)
{
pDoc->FindTextReset();
}
}
}
}
}
示例7: UpdateView
void MLocatorView::UpdateView()
{
POSITION p = theApp.GetFirstDocTemplatePosition();
CDocTemplate* pTemplate = theApp.GetNextDocTemplate(p);
p = pTemplate->GetFirstDocPosition();
CLocatorDoc* pDoc = (CLocatorDoc*)pTemplate->GetNextDoc(p);
if( 0 != pDoc )
{
const MServerStatusMgr* pServerStatusMgr = pDoc->GetLocator()->GetServerStatusMgr();
if( (0 != pServerStatusMgr) && (0 < pServerStatusMgr->GetSize()) )
{
CListCtrl& lc = GetListCtrl();
char szBuf[ 128 ];
string strDeadServerIDList;
const int nDeadServerCount = pServerStatusMgr->GetDeadServerCount();
_snprintf( szBuf, 127, "%d", pServerStatusMgr->GetSize() );
lc.InsertItem( 0, szBuf );
_snprintf( szBuf, 127, "Run:%d, Dead:%d", pServerStatusMgr->GetLiveServerCount(), nDeadServerCount );
lc.SetItemText( 0, 1, szBuf );
for( int i = 0; i < nDeadServerCount; ++i )
{
_snprintf( szBuf, 127, "%d, ", pServerStatusMgr->GetDeadServerIDList()[i] );
strDeadServerIDList += szBuf;
}
strDeadServerIDList += "\0";
lc.SetItemText( 0, 2, strDeadServerIDList.c_str() );
}
}
}
示例8: OnCopyData
BOOL CPlayerFrame::OnCopyData(CWnd* pWnd, COPYDATASTRUCT* pCopyDataStruct)
{
CDocTemplate* pTemplate = NULL;
POSITION pos;
CDocument* pDocument = NULL;
pos = AfxGetApp()->GetFirstDocTemplatePosition();
pTemplate = AfxGetApp()->GetNextDocTemplate( pos );
if ( pCopyDataStruct->dwData == 0 && pCopyDataStruct->lpData )
{
if ( pTemplate )
{
POSITION docpos = pTemplate->GetFirstDocPosition( );
// Loop through documents in this template
while ( docpos )
{
VERIFY( pDocument = pTemplate->GetNextDoc(docpos) );
// update all view attached to this document
pDocument->UpdateAllViews( NULL, WM_PLAYER_ADD_FILE, (CObject*)pCopyDataStruct->lpData );
}
}
}
return CMainFrame::OnCopyData(pWnd, pCopyDataStruct);
}
示例9: OnMatchMerge
void CCWArrangePage::OnMatchMerge ()
{
CPickMergeDlg dlg;
// add all open documents to the list
POSITION pos = AfxGetApp ()->GetFirstDocTemplatePosition ();
CDocTemplate* pDocTmpl = AfxGetApp ()->GetNextDocTemplate (pos);
pos = pDocTmpl->GetFirstDocPosition ();
while (pos)
dlg.m_arrTrackInfo.Add (((CCdCoverCreator2Doc*) pDocTmpl->GetNextDoc (pos))->m_pTracks);
if (dlg.DoModal () == IDOK)
{
// build merged trackinfo
CTracksInfo ti, *pT;
for (int i = 0; i < dlg.m_arrTrackInfo.GetSize (); i++)
{
pT = (CTracksInfo*) dlg.m_arrTrackInfo.GetAt (i);
for (int j = 0; j < pT->GetNumTracks (); j++)
ti.Add (new CTrack (pT->GetTrack (j)));
}
// clear tracks
if (!dlg.m_DontDeleteExisting)
for (int i = 0; i < m_pTracks->GetNumTracks (); i++)
m_pTracks->GetTrack (i).SetText ("", "");
// match tracks
GetTracksInfo ();
m_pTracks->Match (&ti, dlg.m_DontDeleteExisting ? false : true);
// display
SetTracks ();
}
}
示例10: GetWorkspaceName
extern "C" __declspec(dllexport) bool GetWorkspaceName(LPTSTR buffer, int bufSize)
{
if (!g_app)
return false;
POSITION pos = g_app->GetFirstDocTemplatePosition();
while (pos)
{
CDocTemplate* dt = g_app->GetNextDocTemplate(pos);
if (strcmp(dt->GetRuntimeClass()->m_lpszClassName, "CProjectWorkspaceDocTemplate") == 0)
{
POSITION docPos = dt->GetFirstDocPosition();
if (!docPos)
break;
CDocument* doc = dt->GetNextDoc(docPos);
if (!doc)
break;
strcpy(buffer, doc->GetPathName());
return true;
}
}
return false;
}
示例11: OnOK
void CFindByStrDlg::OnOK()
{
// TODO: Add extra validation here
try {
UpdateData(TRUE);
vector<CRossDoc*> RossDocs;
if(GetCheckedRadioButton(IDC_FIND_IN_ALL_DICTS,IDC_FIND_IN_ACTIVE_DICT)==IDC_FIND_IN_ALL_DICTS)
{
CDocTemplate* pRossDocTemplate = GetRossDocTemplate();
POSITION pos = pRossDocTemplate->GetFirstDocPosition();
while( pos )
RossDocs.push_back ((CRossDoc*)pRossDocTemplate->GetNextDoc(pos));
}
else
{
RossDocs.push_back(m_pActiveRossDoc);
};
CWaitCursor C;
vector<CRossPocketItem> PocketItems;
for (int RossDocNo=0; RossDocNo<RossDocs.size(); RossDocNo++)
{
CRossDoc* pRossDoc = RossDocs[RossDocNo];
CTempArticle A;
A.m_pRoss = pRossDoc->GetRoss();
size_t UnitNo;
try {
for (UnitNo = 0; UnitNo < pRossDoc->GetRoss()->GetUnitsSize(); UnitNo++)
{
if (pRossDoc->GetRoss()->IsEmptyArticle(UnitNo)) continue;
A.ReadFromDictionary(UnitNo, false, true);
if (A.GetArticleStr().find(m_FindString) != -1)
PocketItems.push_back(CRossPocketItem(UnitNo, pRossDoc));
};
}
catch (...)
{
string Mess = string ("Errors in article ") + pRossDoc->GetRoss()->GetEntryStr(UnitNo) ;
AfxMessageBox (Mess.c_str());
};
};
C.Restore();
OpenPocket(PocketItems, CString("Search Results for ") + m_FindString);
}
catch (...)
{
AfxMessageBox ("Something is wrong");
};
CDialog::OnOK();
}
示例12: IsLastDocValid
bool CLeftPanelDlgBar::IsLastDocValid()
{
// look whether the last doc is still valid
POSITION pos = AfxGetApp ()->GetFirstDocTemplatePosition ();
CDocTemplate* pDocTmpl = AfxGetApp ()->GetNextDocTemplate (pos);
for (pos = pDocTmpl->GetFirstDocPosition (); pos; )
if (pDocTmpl->GetNextDoc (pos) == m_pLastDoc)
return true;
return false;
}
示例13: SetTitle
void OleDocRoot::SetTitle(LPCTSTR lpszTitle)
{
CString s(lpszTitle);
CDocTemplate* pTempl = GetDocTemplate();
if (pTempl)
{
flag Found = True;
while (Found)
{
Found = False;
POSITION Pos = pTempl->GetFirstDocPosition();
while (Pos && !Found)
{
CDocument * pDoc = pTempl->GetNextDoc(Pos);
if (pDoc!=this)
{
CString Title = pDoc->GetTitle();
if (Title.GetLength()==s.GetLength() && _stricmp((const char*)s, (const char*)Title)==0)
Found = True;
}
}
if (Found)
{
CString Ext = "";
int DotPos = s.ReverseFind('.');
if (DotPos>=0)
{
Ext = s.Mid(DotPos, 256);
s = s.Left(DotPos);
}
int _Pos = s.ReverseFind('_');
if (_Pos>=0)
{
CString ss = s.Mid(_Pos+1, 256);
s = s.Left(_Pos+1);
if (ss.GetLength()>0)
{
char Buff[32];
sprintf(Buff, "%d", atoi((const char*)ss) + 1);
s += Buff;
}
else
s += "1";
}
else
s += "_1";
s += Ext;
}
}
}
COleLinkingDoc::SetTitle((const char*)s);
}
示例14: NotifyAllInPlace
BOOL COleFrameHook::NotifyAllInPlace(
BOOL bParam, BOOL (COleFrameHook::*pNotifyFunc)(BOOL bParam))
{
ASSERT_VALID(this);
HWND hWndFrame = m_hWnd;
CWinApp* pApp = AfxGetApp();
// no doc manager - no templates
if (pApp->m_pDocManager == NULL)
return TRUE;
// walk all templates in the application
CDocTemplate* pTemplate;
POSITION pos = pApp->m_pDocManager->GetFirstDocTemplatePosition();
while (pos != NULL)
{
pTemplate = pApp->m_pDocManager->GetNextDocTemplate(pos);
ASSERT_VALID(pTemplate);
ASSERT_KINDOF(CDocTemplate, pTemplate);
// walk all documents in the template
POSITION pos2 = pTemplate->GetFirstDocPosition();
while (pos2)
{
COleDocument* pDoc = (COleDocument*)pTemplate->GetNextDoc(pos2);
ASSERT_VALID(pDoc);
if (pDoc->IsKindOf(RUNTIME_CLASS(COleDocument)))
{
// walk all COleClientItem objects in the document
COleClientItem* pItem;
POSITION pos3 = pDoc->GetStartPosition();
while ((pItem = pDoc->GetNextClientItem(pos3)) != NULL)
{
if (pItem->m_pInPlaceFrame != NULL &&
pItem->m_pInPlaceFrame->m_lpActiveObject != NULL &&
pItem->m_pView != NULL &&
AfxIsDescendant(hWndFrame, pItem->m_pView->m_hWnd))
{
// Whew! Found an in-place active item that is
// part of this frame window hierarchy.
COleFrameHook* pNotifyHook = pItem->m_pInPlaceFrame;
if (!(pNotifyHook->*pNotifyFunc)(bParam))
return FALSE;
}
}
}
}
}
return TRUE;
}
示例15: FindSkinFile
CDocument* CFileView::FindSkinFile(CString& strPath)
{
CDocTemplate* pDocTemplate = theApp.GetUIDocTemplate();
POSITION posDoc = pDocTemplate->GetFirstDocPosition();
while (posDoc != NULL)
{
CDocument* pDoc = pDocTemplate->GetNextDoc(posDoc);
if ((pDoc != NULL) && (pDoc->GetPathName() == strPath))
{
return pDoc;
}
}
return NULL;
}