Getting ptr to App class?

I have a list of items I have stored in a CList in my projects CMyprojectApp's class. I want to display this list in the dialog display. I assume the best way is in the OnDraw member function.

However, I can't 'get to' my list in the App class!? How do I get to it?

Or is this a bad design, and should I be building my list somewhere else?... the list is created by reading in a text file of items during program startup.
Who is Participating?
thresher_sharkConnect With a Mentor Commented:
No problemo:

((CMyApp *) AfxGetApp ())->m_Yourlist

If you have questions, please feel free to ask :-)
gunnAuthor Commented:
Ahhhhhh, jeez. I tried this, but it seems I didn't cast it to my app! ((CMyApp *)  doh!

hehe.  Oh well, at least you got it working.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.