MCPcopy Create free account
hub / github.com/mhammond/pywin32 / FindOpenDocument

Method FindOpenDocument

Pythonwin/win32app.cpp:76–97  ·  view source on GitHub ↗

FindOpenDocument - if the C++ framework has a document with this name open, then return a pointer to it, else NULL.

Source from the content-addressed store, hash-verified

74// FindOpenDocument - if the C++ framework has a document with this name open,
75// then return a pointer to it, else NULL.
76CDocument *CProtectedWinApp::FindOpenDocument(const TCHAR *lpszFileName)
77{
78 POSITION posTempl = m_pDocManager->GetFirstDocTemplatePosition();
79 CDocument* pOpenDocument = NULL;
80
81 TCHAR szPath[_MAX_PATH];
82 if (!AfxFullPath(szPath, lpszFileName))
83 _tcscpy(szPath, lpszFileName);
84
85 while (posTempl) {
86 CDocTemplate* pTemplate = m_pDocManager->GetNextDocTemplate(posTempl);
87 ASSERT(pTemplate->IsKindOf(RUNTIME_CLASS(CDocTemplate)));
88 // go through all documents
89 POSITION posDoc = pTemplate->GetFirstDocPosition();
90 while (posDoc) {
91 CDocument* pDoc = pTemplate->GetNextDoc(posDoc);
92 if (lstrcmpi(pDoc->GetPathName(), szPath) == 0)
93 return pDoc;
94 }
95 }
96 return NULL;
97}
98
99CProtectedDocManager *CProtectedWinApp::GetDocManager()
100{

Callers 9

CreateMethod · 0.45
ui_find_open_documentFunction · 0.45
SetLineStateMethod · 0.45
ResetLineStateMethod · 0.45
ShowLineNoMethod · 0.45
MatchDocTypeMethod · 0.45
MatchDocTypeMethod · 0.45
MatchDocTypeMethod · 0.45
MatchDocTypeMethod · 0.45

Calls 1

GetPathNameMethod · 0.45

Tested by

no test coverage detected