It's not clear what types your variables are, but as you have pDoc
and frame
, I'm assuming that the former is your CDocument
derived class and the latter is possibly a CFrameWnd
or CMDIFrameWnd
derived class.
If I'm not far wrong, then the reason why the tab titles aren't sticking is that you should be calling SetTitle
on the CDocument
that's behind each tabbed view, so something like
tabval = "Report_" + pDoc->rptData.reportId.Strip();
winval = tabval;
if (changed) {
tabval += " *";
winval += " (modified)";
}
pDoc->SetTitle(tabval); // set tab title on CDocument