OK I am kind of new at VC++ and really new to MFC programs.
I have a MFC FormView program that has just an Edit Box on a form. What I want to do is save the text from the Edit Box to a file also write the text from a text file to the edit box.
In my View Object I have DoData Exchange that saves the text to a VAR called editTextOut.
Question 1: Is using //#1 & //#2 the correct way to point pView to the CTestFrmViewView object? I got this from an example somewhere else, but it just seems like the wrong way to do it.Code:void CTestMFCFrmViewDoc::Serialize(CArchive& ar) { CString F = ""; //#1 CTestFrmViewView* pView = (CTestFrmViewView*)m_viewList.GetHead(); //#2 ASSERT_KINDOF(CTestFrmViewView, pView); if (ar.IsStoring()) { pView->UpdateData(); F = pView->editTextOut; ar << F; } else { ar >> F; pView->RedrawWindow(NULL,NULL, RDW_ERASENOW); } }
Question 2: After I read in the text from a text file how do I send the edit box?
Thanks




Reply With Quote