vc中如何在APP类中获得DOC类的指针!? RT 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 CMyView *pView = (CMyView *)((CMainFrame *)AfxGetMainWnd())->GetActiveView(); pView->GetDocument() ;不要忘记了包含相关文件技术上可行符合你的要求吗?如果不明白请给我发短消息请附: 帖子的地址 把pDocTemplate变为app的成员变量。POSITION p = pDocTemplate->GetFirstDocPosition();if(p!=NULL){ CDocument* pDoc = pDocTemplate->GetNextDoc(p); //p = pDoc->GetFirstViewPosition(); //CView* pView = pDoc->GetNextView(p);} ((CFrameWnd *)AfxGetMainWnd())->GetActiveDocument() //Assume only Doc associated with each DocTemplatePOSITION psTemplate = this->GetFirstDocTemplatePosition();CDocTemplate *pDocTemplate = NULL;CDocument *pDoc = NULL;while(psTemplate){ pDocTemplate = this->GetNextDocTemplate(psTemplate); if(NULL != pDocTemplate) { CString strDoc; pDocTemplate->GetDocString(strDoc,CDocTemplate::filterExt); if(!strcmp(".YourDocType",strDoc)) { // ok Find the Doc. Get the Doc Pointer; POSITION ps = pDocTemplate->GetFirstDocPosition(); pDoc = pDocTemplate->GetNextDoc(ps); break; } }} include "XXView.h"CXXView *pView = (CXXView *)((CMainFrame *)AfxGetMainWnd())->GetActiveView();pView->GetDocument() ; MFC对话框小问题 vs2008如何让项目只连接MFC42的库? 重叠IO中的wsasend()函数cannot convert parameter 7问题 VC下怎样获得一个文件目录下的所有文件数目? 有哪些Windows电源管理函数啊?(在线等待) 一个关于UNICODE的问题 --->>极度菜鸟问题:如何COPY整个目录?在线等待 免费试用 关于CONNECTION类 SOS!SOS!SOS!请教CAchive ar(CFile*,...)的问题 想问一些视频方面入门级的经典书? 单选框的问题(没有用mfc)急!
不要忘记了包含相关文件
技术上可行
符合你的要求吗?
如果不明白
请给我发短消息
请附: 帖子的地址
if(p!=NULL)
{
CDocument* pDoc = pDocTemplate->GetNextDoc(p);
//p = pDoc->GetFirstViewPosition();
//CView* pView = pDoc->GetNextView(p);
}
POSITION psTemplate = this->GetFirstDocTemplatePosition();
CDocTemplate *pDocTemplate = NULL;
CDocument *pDoc = NULL;
while(psTemplate)
{
pDocTemplate = this->GetNextDocTemplate(psTemplate);
if(NULL != pDocTemplate)
{
CString strDoc;
pDocTemplate->GetDocString(strDoc,CDocTemplate::filterExt);
if(!strcmp(".YourDocType",strDoc))
{
// ok Find the Doc. Get the Doc Pointer;
POSITION ps = pDocTemplate->GetFirstDocPosition();
pDoc = pDocTemplate->GetNextDoc(ps);
break;
} }
}
CXXView *pView = (CXXView *)((CMainFrame *)AfxGetMainWnd())->GetActiveView();
pView->GetDocument() ;