Skip to content

Instantly share code, notes, and snippets.

@nibasya
Created March 11, 2020 14:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nibasya/c1d400f1a12f8f0d7aa66d7c7568e7b1 to your computer and use it in GitHub Desktop.
Save nibasya/c1d400f1a12f8f0d7aa66d7c7568e7b1 to your computer and use it in GitHub Desktop.
Example of finding CView from CDocument
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