I need to refer to, and set an Application variable from my Dialog class. I tried this:
CMyAppApp * pApp = AfxGetApp();
The error says it needs reinterpret_cast, C-style cast or function-style cast. So I tried:
CMyAppApp * pApp = dynamic_cast<CMyAppApp *>(AfxGetApp());
I still get a warning saying 'dynamic_cast' used on polymorphic type 'class CWinApp' with /GR-; unpredictable behavior may result. The app. crashes at that line.
What's wrong? How else can I refer to an App. class variable? Someone please explain?
TIA
Sudhir
CMyAppApp * pApp = AfxGetApp();
The error says it needs reinterpret_cast, C-style cast or function-style cast. So I tried:
CMyAppApp * pApp = dynamic_cast<CMyAppApp *>(AfxGetApp());
I still get a warning saying 'dynamic_cast' used on polymorphic type 'class CWinApp' with /GR-; unpredictable behavior may result. The app. crashes at that line.
What's wrong? How else can I refer to an App. class variable? Someone please explain?
TIA
Sudhir