Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17


Getting ptr to App class?

Posted on 1999-07-27
Medium Priority
Last Modified: 2013-11-20
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.
Question by:gunn
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2

Accepted Solution

thresher_shark earned 200 total points
ID: 1311647
No problemo:

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

If you have questions, please feel free to ask :-)

Author Comment

ID: 1311648
Ahhhhhh, jeez. I tried this, but it seems I didn't cast it to my app! ((CMyApp *)  doh!


Expert Comment

ID: 1311649
hehe.  Oh well, at least you got it working.

Featured Post

Enroll in September's Course of the Month

This month’s featured course covers 16 hours of training in installation, management, and deployment of VMware vSphere virtualization environments. It's free for Premium Members, Team Accounts, and Qualified Experts!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction: Finishing the grid – keyboard support for arrow keys to manoeuvre, entering the numbers.  The PreTranslateMessage function is to be used to intercept and respond to keyboard events. Continuing from the fourth article about sudoku. …
Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
Want to learn how to record your desktop screen without having to use an outside camera. Click on this video and learn how to use the cool google extension called "Screencastify"! Step 1: Open a new google tab Step 2: Go to the left hand upper corn…
Suggested Courses

664 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question