Created
March 11, 2020 14:46
-
-
Save nibasya/c1d400f1a12f8f0d7aa66d7c7568e7b1 to your computer and use it in GitHub Desktop.
Example of finding CView from CDocument
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
void CShowOfflineFilesDoc::Example() | |
{ | |
CView* pv = FindView(RUNTIME_CLASS(CSearchResult)); | |
} | |
CView* CShowOfflineFilesDoc::FindView(CRuntimeClass* rc) | |
{ | |
POSITION p = GetFirstViewPosition(); | |
CView* pRet; | |
while (p != NULL) { | |
pRet = GetNextView(p); | |
if (pRet->IsKindOf(rc)) { | |
return pRet; | |
} | |
} | |
return nullptr; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment