IssacJones
asked on
Initializing a const in the view from Doc
Hiya
I have an MFC SDI application.
In the View I have a variable
const CString ViewMessage
I want to initialize this variable from a value in the Doc e.g. DocMessage.
As the variable is const I have to initialize it in the constructor list. How do I do this?
I tried adding
ViewMessage(GetDocument()- >DocMessag e)
to the View initialization list and it compiles. Unfortunately, when I run it, it just causes an assertion and loads of memory leaks.
Can anybody help?
John
I have an MFC SDI application.
In the View I have a variable
const CString ViewMessage
I want to initialize this variable from a value in the Doc e.g. DocMessage.
As the variable is const I have to initialize it in the constructor list. How do I do this?
I tried adding
ViewMessage(GetDocument()-
to the View initialization list and it compiles. Unfortunately, when I run it, it just causes an assertion and loads of memory leaks.
Can anybody help?
John
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.