当前位置: 首页>>代码示例>>C++>>正文


C++ CDocument类代码示例

本文整理汇总了C++中CDocument的典型用法代码示例。如果您正苦于以下问题:C++ CDocument类的具体用法?C++ CDocument怎么用?C++ CDocument使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了CDocument类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: FindSkinFile

BOOL CFileView::CloseSkinFile(CString& strPath)
{
	CDocument* pDoc = FindSkinFile(strPath);
	if(pDoc == NULL)
		return FALSE;

	pDoc->OnCloseDocument();

	return TRUE;
}
开发者ID:DayDayUpCQ,项目名称:misc,代码行数:10,代码来源:FileView.cpp

示例2: GetDocument

void SECEditView::UpdateViews(CWnd* pSender, LPARAM lHint, CObject* pHint)
{
	// This is declared in SECEditCore.h because many OE functions
	// Update the view. The default implementation does nothing
	// and is called for SECEditCtrl derivatives. This is called
	// for SECEditView derivatives
	CDocument* pDoc = GetDocument();
	if (pDoc)
		pDoc->UpdateAllViews((CView*)pSender, lHint, pHint);
}
开发者ID:LM25TTD,项目名称:ATCMcontrol_Engineering,代码行数:10,代码来源:SECEditView.cpp

示例3: InstrumentChanged

void CInstrument::InstrumentChanged() const
{
	// Set modified flag
	CFrameWnd *pFrameWnd = dynamic_cast<CFrameWnd*>(AfxGetMainWnd());
	if (pFrameWnd != NULL) {
		CDocument *pDoc = pFrameWnd->GetActiveDocument();
		if (pDoc != NULL)
			pDoc->SetModifiedFlag();
	}
}
开发者ID:BattyBovine,项目名称:UmaTracker,代码行数:10,代码来源:Instrument.cpp

示例4: Open

LPDISPATCH CMUSHclientDoc::Open(LPCTSTR FileName) 
{

//CDocument * pDoc = App.m_pWorldDocTemplate->OpenDocumentFile (FileName);
CDocument * pDoc = App.OpenDocumentFile (FileName);

  if (pDoc)
      return pDoc->GetIDispatch (TRUE);

	return NULL;
}   // end of CMUSHclientDoc::Open
开发者ID:salmonrose,项目名称:mushclient,代码行数:11,代码来源:methods_utilities.cpp

示例5: ui_doc_is_modified

// @pymethod int|PyCDocument|IsModified|Return a flag indicating if the document has been modified.
PyObject *
ui_doc_is_modified(PyObject *self, PyObject *args)
{
	CDocument *pDoc;
	if (!(pDoc=PyCDocument::GetDoc(self)))
		return NULL;
	CHECK_NO_ARGS2(args,IsModified);
	GUI_BGN_SAVE;
	int rc = pDoc->IsModified();
	GUI_END_SAVE;
	return Py_BuildValue("i", rc); // @pyseemfc CDocument|IsModified
}
开发者ID:malrsrch,项目名称:pywin32,代码行数:13,代码来源:win32doc.cpp

示例6: ui_doc_get_title

// @pymethod string|PyCDocument|GetTitle|Returns the title of the current document.
// This will often be the file name portion of the path name.
PyObject *
ui_doc_get_title(PyObject *self, PyObject *args)
{
	CDocument *pDoc;
	if (!(pDoc=PyCDocument::GetDoc(self)))
		return NULL;
	CHECK_NO_ARGS2(args,GetTitle);
	GUI_BGN_SAVE;
	CString path = pDoc->GetTitle(); // @pyseemfc CDocument|GetTitle
	GUI_END_SAVE;
	return PyWinObject_FromTCHAR(path);
}
开发者ID:malrsrch,项目名称:pywin32,代码行数:14,代码来源:win32doc.cpp

示例7: GetFirstDocPosition

void CDocTemplate::OnIdle()
{
	POSITION pos = GetFirstDocPosition();
	while (pos != NULL)
	{
		CDocument* pDoc = GetNextDoc(pos);
		ASSERT_VALID(pDoc);
		ASSERT_KINDOF(CDocument, pDoc);
		pDoc->OnIdle();
	}
}
开发者ID:Rupan,项目名称:winscp,代码行数:11,代码来源:doctempl.cpp

示例8: GetDoubleClickedItem

void CXTPShellListView::OnDblclk(NMHDR* /*pNMHDR*/, LRESULT* pResult)
{
	int iIndex = GetDoubleClickedItem();
	if (iIndex >= 0)
	{
		CDocument* pDoc = GetDocument();
		pDoc->UpdateAllViews(this, SHN_XTP_SELECTCHILD,
			(CObject*)GetListCtrl().GetItemData(iIndex));
	}
	*pResult = 0;
}
开发者ID:lai3d,项目名称:ThisIsASoftRenderer,代码行数:11,代码来源:XTPShellListCtrlView.cpp

示例9: GetActiveDocument

HMENU COleIPFrameWnd::GetInPlaceMenu()
{
	// get active document associated with this frame window
	CDocument* pDoc = GetActiveDocument();
	ASSERT_VALID(pDoc);

	// get in-place menu from the doc template
	CDocTemplate* pTemplate = pDoc->GetDocTemplate();
	ASSERT_VALID(pTemplate);
	return pTemplate->m_hMenuInPlaceServer;
}
开发者ID:rickerliang,项目名称:OpenNT,代码行数:11,代码来源:oleipfrm.cpp

示例10: test_parser

void test_parser() {
	std::string page("<h1><a>wrong link</a><a class=\"special\"\\>some link</a></h1>");
	CDocument doc;
	doc.parse(page.c_str());

	CSelection c = doc.find("h1 a.special");
	CNode node = c.nodeAt(0);
	printf("Node: %s\n", node.text().c_str());
	std::string content = page.substr(node.startPos(), node.endPos()-node.startPos());
	printf("Node: %s\n", content.c_str());
}
开发者ID:chai2010-playground,项目名称:gumbo-query,代码行数:11,代码来源:main.cpp

示例11: OpenPocket

int OpenPocket(   const vector<CRossPocketItem>& UnitNos,
			  CString    Title) 
{

	CDocTemplate* tmpl = GetRossPocketTemplate();;

	CDocument* pDocument = tmpl->CreateNewDocument();

	if (pDocument == NULL)
	{
		TRACE0("CDocTemplate::CreateNewDocument returned NULL.\n");
		AfxMessageBox(AFX_IDP_FAILED_TO_CREATE_DOC);
		return false;
	}

    ASSERT_VALID(pDocument);

	pDocument->m_bAutoDelete = FALSE;   // don't destroy if something goes wrong
	CFrameWnd* pFrame = tmpl->CreateNewFrame(pDocument, NULL);
	pDocument->m_bAutoDelete = TRUE;
	if (pFrame == NULL)
	{
		AfxMessageBox(AFX_IDP_FAILED_TO_CREATE_DOC);
		delete pDocument;       // explicit delete on error
		return FALSE;
	};

	ASSERT_VALID(pFrame);

	pDocument->SetPathName(CString("An entry subset by  ")+Title);
	

	// open an existing document
	tmpl->InitialUpdateFrame(pFrame, pDocument, TRUE);

	POSITION pos =  pDocument->GetFirstViewPosition();
	CPocketForm* V = (CPocketForm*)(pDocument->GetNextView(pos));
	V->m_PocketItems = UnitNos;
    V->m_WordList.InsertColumn(1,"Словарный вход", LVCFMT_LEFT, 200);
	V->m_WordList.InsertColumn(2,"Номер значения", LVCFMT_LEFT, 60);
	V->m_WordList.InsertColumn(2,"Название словаря", LVCFMT_LEFT, 60);
	V->m_WordList.SetItemCountEx(UnitNos.size());
	V->m_UnitsSize.Format ("Число словарных входов : %i",    V->m_WordList.GetItemCount());
    V->UpdateData(FALSE);
    V->m_WordList.UpdateData(FALSE);
    V->m_WordList.Invalidate();	
	V->m_Title = Title;

	// установка размеров
	V->GetParent()->SetWindowPos(NULL, 0,0, 535 , 500, SWP_SHOWWINDOW|SWP_NOZORDER|SWP_NOMOVE);
	return true;
};
开发者ID:deNULL,项目名称:seman,代码行数:52,代码来源:PocketForm.cpp

示例12: s

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);
  }
开发者ID:ChrisMoreton,项目名称:Test3,代码行数:52,代码来源:Docroot.cpp

示例13: while

CWnd* WPhonePlugin::GetActiveWnd(CMultiDocTemplate* doc)
{
	CWnd* pView = NULL;
	POSITION posdoc = doc->GetFirstDocPosition();
	while(posdoc != NULL)
	{
		CDocument* pdoc = doc->GetNextDoc(posdoc);
		POSITION posview = pdoc->GetFirstViewPosition();
		pView = (pdoc->GetNextView(posview));
	}

	return pView;
}
开发者ID:diduoren,项目名称:youeryuan,代码行数:13,代码来源:WPhonePlugin.cpp

示例14:

CMDIChildWnd *CMDIChildIter::GetNextChild()
{
	CDocument	*pDoc = m_DocIter.GetNextDoc();
	if (pDoc != NULL) {
		POSITION	pos = pDoc->GetFirstViewPosition();
		if (pos != NULL) {
			CView	*pView = pDoc->GetNextView(pos);
			if (pView != NULL)
				return(DYNAMIC_DOWNCAST(CMDIChildWnd, pView->GetParentFrame()));
		}
	}
	return(NULL);
}
开发者ID:victimofleisure,项目名称:WaveShop,代码行数:13,代码来源:DocIter.cpp

示例15: OnFileNew

void CFileView::OnFileNew()
{
	CMultiDocTemplate* pUIDocTemplate = theApp.GetUIDocTemplate();
	CDocument* pDoc = pUIDocTemplate->OpenDocumentFile(NULL);
	CString strFilePath = CGlobalVariable::m_strProjectPath + pDoc->GetTitle() + _T(".xml");
	pDoc->DoSave(strFilePath);
	HTREEITEM hSelectedItem = m_wndFileView.GetSelectedItem();
	DWORD dwInfo = m_wndFileView.GetItemData(hSelectedItem);
	HTREEITEM hParent = (dwInfo != INFO_FILE) ? hSelectedItem : m_wndFileView.GetParentItem(hSelectedItem);
	HTREEITEM hNewItem = m_wndFileView.InsertItem(pDoc->GetTitle(), 2, 2, hParent);
	m_wndFileView.SetItemData(hNewItem, INFO_FILE);
	m_wndFileView.Expand(hParent, TVE_EXPAND);
}
开发者ID:DayDayUpCQ,项目名称:misc,代码行数:13,代码来源:FileView.cpp


注:本文中的CDocument类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。