Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Access the view class from the menu class.

Status
Not open for further replies.

Paris1849

Programmer
Mar 22, 2001
7
US
I have an SDI application, and all I want to do is to access data in the view class of the program from within member functions of the class which is controlling the menu. How exactly do I get a pointer to the view in those parts of the code?

In detail--> I have data in the view class for the color of certain things drawn within the view. I want a menu item called "Preferences" to open a dialog wherein the user will select custom colors. I have already created the menu and the dialog. How do I get/alter the colors from the view class? hmmmm...

[Aside: I used to program in C in DOS for years. I love Win32 programming, but my biggest complaint is the problem of data not being in scope in different "parts" of your program. For example, the only way to write code within the "main loop" of your program that controls what the user sees is to get a pointer to the view via a chain of several pointers and all this "GetNextDocPosition()" crap. All this within the Onidle() member function of the application class. You end up having to access all your view data via giant, dereferenced variables. eg. "pointer_to_the_View->data_in_your_view_class = whatever." Is anyone else as turned off as I am off as I am with all this scope garbage?]

-----
Paris
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top