Accessing CEdit Member Functions Inside CEditView ::MFC
I think the best approach for the problem I am working on is to use the technique Prosise demostrates in his book using the CStdioFile class. It is a good alternative to serialization.
I need a way to edit the display the data in the file, which are most likely texts. I derived a view from CEditView. I looked to CEditView in MSDN and found that it is possible to get a reference of the CEdit object to modify data currently in the CEditView class. However, Visual C++ displays errors when I tried to gain access to CEdit.
Here is the code:
CEdit myEdit = GetEditCtrl() // I saw this function in MSDN
int i = 0;
while (myEdit->GetLine(i, data))
myCStringArray.SetAtGrow(i, i + 1);
The code above is suppose to copy texts from whatever was stored in the CEdit class into an array of CString.
Visual C++ displayed this error:
C:\Projects\TextView.cpp(121) : error C2440: 'initializing' : cannot convert from 'class CEdit' to 'class CEdit'
No copy constructor available for class 'CEdit'
Am I doing something wrong as far as trying access the CEdit within the CEditView?