Here would be a possible way
to iterate all opened documents views (in your case one view) :) :
void CMainFrame::SendStringToOpenedView(const CString& cszMessage)
{
CWinApp* pcApp = AfxGetApp();
if (pcApp) {
POSITION pos = pcApp->GetFirstDocTemplatePosition();
while (pos) {
CDocTemplate* pcTemplate = pcApp->GetNextDocTemplate(pos);
if (pcTemplate) {
POSITION posDoc = pcTemplate->GetFirstDocPosition();
while (posDoc) {
CDocument* pcDoc = pcTemplate->GetNextDoc(posDoc);
if (pcDoc) {
POSITION posView = pcDoc->GetFirstViewPosition();
while (posView) {
CYourView* pcView = DYNAMIC_DOWNCAST(CYourView, pcDoc->GetNextView(posView));
if (pcView->GetSafeHwnd()) {
pcView->TakeString(cszMessage);
}
}
}
}
}
}
}
}