MFC FormView Question

Started by
0 comments, last by Prairie 22 years, 10 months ago
I don''t know if this belongs here or in the platform specific forum, so if this isn''t appropriate i''ll be happy to put it there. Anyway, on to my question. I have two different form views in my app (on the screen at the same time thanks to splitters). When I press a pushbutton on one form it needs to check the states of checkbox''s on the other. IsDlgButtonChecked() isn''t working. It isn''t generating any errors or warnings. Any thoughts; Prairie
Advertisement
Multiple views basically have no way of talking to each other in standard doc/view architecture.

There are a few ways you can do this. One is to ask the document to send an update method to everyone, and to keep a copy of what''s supposed to be happening in the document (the document is, after all, supposed to be responsible for storage of all actual data). A second is to always tell the document when the state changes, so that the document always knows exactly what the second view knows. Another is to call a function in the document written for the express purpose of sending a message to the first view telling it the current state of the second view. I guess you could also give the "master" view knowledge of the other view, but that''s technically a violation of the architecture and I wouldn''t suggest it.

I suggest that you keep a list of the states from the second form in the document, and inform the document of any state changes, that way when you push the button you merely retrieve the data from the document. That sounds like the simplest implementation of this particular problem to me.

-fel
~ The opinions stated by this individual are the opinions of this individual and not the opinions of her company, any organization she might be part of, her parrot, or anyone else. ~

This topic is closed to new replies.

Advertisement