|
-
January 15th, 2012, 05:01 AM
#1
Class Design
Hello,
I have a question about my win32 class again, but this is not about stuff inside it. More about how I should work with class designs.
I create for instance a Dialog, it will go like this:
Code:
class Dialog : public Wintraits
class WinTrais: public WinFunc, public WinIcon, public WinBGround
The 'problem?' lies in WinTraits, there is my HWND stored, but all other classes need that specific HWND of the control to. So now I'm passing the HWND to Winfunc, WinIcon,WinBGround with a function, whenever the HWND of Wintraits is setted. I doubt this is the best way of doing this. So perhaps would this be a better solution:
Code:
class Dialog : public WinFunc
class WinFunc : public WinIcon
class WinIcon : public WinBGround
Class WinBGround : oublic WinTrats
Now I can store the HWND in Wintraits and then all other classes can use it. Is this ebtter, because it seems a bit weird to me?
Thanks for reading
Grz
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|