You should get the data from the document, not the view. Get the active document by calling CFrameWnd::GetActiveDocument.