Link to home
Start Free TrialLog in
Avatar of IssacJones
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()->DocMessage)

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
Avatar of Zoppo
Zoppo
Flag of Germany image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial