本文整理汇总了C++中CWinApp::GetNextDocTemplate方法的典型用法代码示例。如果您正苦于以下问题:C++ CWinApp::GetNextDocTemplate方法的具体用法?C++ CWinApp::GetNextDocTemplate怎么用?C++ CWinApp::GetNextDocTemplate使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CWinApp
的用法示例。
在下文中一共展示了CWinApp::GetNextDocTemplate方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: 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);
}
}
}
示例2: SendMessageToView
// 在 Frame中发消息给View
U32 CPluginApp_i::SendMessageToView(UINT ulMsg, WPARAM wParam, LPARAM lParam)
{
CWinApp* pWinApp = AfxGetApp();
if(pWinApp)
{
POSITION DocTemplatePos = pWinApp->GetFirstDocTemplatePosition();
//while(DocTemplatePos)
{
CMultiDocTemplate* pDocTemp = (CMultiDocTemplate*)pWinApp->GetNextDocTemplate(DocTemplatePos);
//
POSITION pos = pDocTemp->GetFirstDocPosition ();
// Find the doc within the same doctemplate.
while (pos)
{
CDocument* pDoc = pDocTemp->GetNextDoc (pos);
POSITION ViewPos = pDoc->GetFirstViewPosition ();
CView* pView = pDoc->GetNextView (ViewPos);
if(pView)
{
CMDIChildWnd* pFrame = (CMDIChildWnd*)pView->GetParentFrame();
if(pFrame == this)
{
//OutputDebugString("Find!\n");
pView->SendMessage(ulMsg, wParam, lParam);
}
}
}
}
}
return 0;
}
示例3: OnButtonHomepage
void CMainFrame::OnButtonHomepage()
{
// TODO: 在此添加命令处理程序代码
CWinApp* pApp = AfxGetApp();
// Get the correct document template.
POSITION pos = pApp->GetFirstDocTemplatePosition();
CDocTemplate* pDocTemplate = pApp->GetNextDocTemplate(pos);
// Create a new frame.
CFrameWnd* pFrame = pDocTemplate->CreateNewFrame(
pDocTemplate->CreateNewDocument(),
(CFrameWnd*)AfxGetMainWnd());
// Activate the frame.
pDocTemplate->InitialUpdateFrame(pFrame, NULL);
CXiYuanView* pView = (CXiYuanView*)pFrame->GetActiveView();
pView->Navigate2(_T("http://vod.cau.edu.cn/"), NULL, NULL);
//CXiYuanView *pView = (CXiYuanView*)this->GetActiveView();
////assert(pView);
//LPDISPATCH *ppDisp=NULL ;
//pView->SetRegisterAsBrowser(TRUE);
//*ppDisp = pView->GetApplication();
//BOOL cancel = false;
//pView->OnNewWindow2(ppDisp,&cancel);
//打开爱思主页新选项卡
// Get a pointer to the application object.
//CWinApp* pApp = AfxGetApp();
//
//// Get the correct document template.
//POSITION pos = pApp->GetFirstDocTemplatePosition();
//CDocTemplate* pDocTemplate = pApp->GetNextDocTemplate(pos);
//// Create a new frame.
//CFrameWnd* pFrame = pDocTemplate->CreateNewFrame(
// pDocTemplate->CreateNewDocument(),
// (CFrameWnd*)AfxGetMainWnd());
//// Activate the frame.
//pDocTemplate->InitialUpdateFrame(pFrame, NULL);
//CXiYuanView* pView = (CXiYuanView*)pFrame->GetActiveView();
//// Pass pointer of WebBrowser object.
//pView->SetRegisterAsBrowser(TRUE);
//LPDISPATCH ppDisp = pView->GetApplication();
//
////assert(ppDisp);
//BOOL Cancel = TRUE;
//pView->OnNewWindow2(&ppDisp,& Cancel);
}
示例4: update_display
void Daten::update_display()
{
CWinApp *a;
CDocTemplate *t;
CDocument *d;
CView *v;
POSITION p;
a = AfxGetApp();
p = a->GetFirstDocTemplatePosition();
t = a->GetNextDocTemplate( p);
p = t->GetFirstDocPosition();
d = t->GetNextDoc( p);
p = d->GetFirstViewPosition();
v = d->GetNextView( p);
v->RedrawWindow();
}
示例5: GetDocument
CBioSIMDoc* CResultDataWnd::GetDocument()
{
CDocument* pDoc = NULL;
CWinApp* pApp = AfxGetApp();
if (pApp)
{
POSITION pos = pApp->GetFirstDocTemplatePosition();
CDocTemplate* docT = pApp->GetNextDocTemplate(pos);
if (docT)
{
pos = docT->GetFirstDocPosition();
pDoc = docT->GetNextDoc(pos);
}
}
return static_cast<CBioSIMDoc*>(pDoc);
}
示例6: GetDocument
CWeatherUpdaterDoc* CTaskPropertyWnd::GetDocument()
{
CWeatherUpdaterDoc* pDoc = NULL;
CWinApp* pApp = AfxGetApp();
if (pApp)
{
POSITION pos = pApp->GetFirstDocTemplatePosition();
CDocTemplate* docT = pApp->GetNextDocTemplate(pos);
if (docT)
{
pos = docT->GetFirstDocPosition();
pDoc = (CWeatherUpdaterDoc*)docT->GetNextDoc(pos);
}
}
return pDoc;
}
示例7: OnButtonSport
void CMainFrame::OnButtonSport()
{
// TODO: 在此添加命令处理程序代码
CWinApp* pApp = AfxGetApp();
// Get the correct document template.
POSITION pos = pApp->GetFirstDocTemplatePosition();
CDocTemplate* pDocTemplate = pApp->GetNextDocTemplate(pos);
// Create a new frame.
CFrameWnd* pFrame = pDocTemplate->CreateNewFrame(
pDocTemplate->CreateNewDocument(),
(CFrameWnd*)AfxGetMainWnd());
// Activate the frame.
pDocTemplate->InitialUpdateFrame(pFrame, NULL);
CXiYuanView* pView = (CXiYuanView*)pFrame->GetActiveView();
pView->Navigate2(_T("http://vod.cau.edu.cn/index.php?mod=category&action=view&id=106"), NULL, NULL);
}
示例8: OnButtonSearch
void CMainFrame::OnButtonSearch()
{
// TODO: 在此添加命令处理程序代码
CString path;
path=L"http://vod.cau.edu.cn/index.php?type=title&keyword="+m_search+L"&mod=content&action=search";
// TODO: 在此添加命令处理程序代码
CWinApp* pApp = AfxGetApp();
// Get the correct document template.
POSITION pos = pApp->GetFirstDocTemplatePosition();
CDocTemplate* pDocTemplate = pApp->GetNextDocTemplate(pos);
// Create a new frame.
CFrameWnd* pFrame = pDocTemplate->CreateNewFrame(
pDocTemplate->CreateNewDocument(),
(CFrameWnd*)AfxGetMainWnd());
// Activate the frame.
pDocTemplate->InitialUpdateFrame(pFrame, NULL);
CXiYuanView* pView = (CXiYuanView*)pFrame->GetActiveView();
pView->Navigate2(path, NULL, NULL);
}