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
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