Sign in to follow this  

Interaction Betwen MDI Child Windows

This topic is 3310 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I have around 8 MDI Child Windows each doing a unique 'job', each Window is represented by a Class and has its own Message Proc. Many of these classes are required to interact with each other. What is the best way to communicate between them all? I have had ideas including: 1. Initialising each class with pointers to other classes. 2. Registering messages with Windows and sending data to different WndProc's. 3. Having a central class deal with interactions between each of the Child Windows. I am having trouble decided which one is best or if there is a better solution. Any and all ideas welcome, thanks.

Share this post


Link to post
Share on other sites
It entirely depends on your (code) style and liking.

1) tightly couples your windows with each other. Depending on your app this must not be a bad thing.

2) is pretty much 3 but using existing Win32 functionality.

3) can be done with an observer/listener pattern, there being decoupled from Win32.

Share this post


Link to post
Share on other sites
How about decoupling your work from the UI and using an observer pattern or the like? If you have 8 worker classes doing different jobs, you could link the classes to eachother using a ProgressObserver, or a DirtyJobObserver, a SimpleButMindlessJobObserver, etc. These observer classes are nothing but an interface and make it easy for you to break the dependancy of the other worker classes.

Of course, in the end, the UI just uses the observers to get their information from the real classes, and the other 8 classes communicate through them aswell. It requires some more work, but it's cleaner.

Toolmaker

Share this post


Link to post
Share on other sites

This topic is 3310 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this