rickatseasoft
asked on
Getting CRichEditCtrl
I am trying to get a CRichEditCtrl by creating a member variable
CRichEditCtrl &m_RichCtrl
and then call m_RichCtrl=GetRichEditCtrl ();
The compiler complains:error C2758: 'm_RichCtrl' : must be initialized in constructor base/member initializer list
Can anyone explain why and how to fix it?
Thanks, Rick
CRichEditCtrl &m_RichCtrl
and then call m_RichCtrl=GetRichEditCtrl
The compiler complains:error C2758: 'm_RichCtrl' : must be initialized in constructor base/member initializer list
Can anyone explain why and how to fix it?
Thanks, Rick
ASKER
It certainly works as you suggest, but I wonder if you hi\ave the time to explain why?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
// declare locally
CRichEditCtrl &richCtrl=GetRichEditCtrl(
// use it here
richTrl.DoSomething();
or even you can use directly without using a variable:
GetRichEditCtrl().DoSometh