I understand that CButton, CEdit, etc are all conveniant classes that are easy to implement, but to overriding them and stop certain super class functions to implement your own button functionallity, is a bit of a hastle. Wouldn’t it be more practical just to override CWnd and start from scratch? This is more a principal-based question, ie is it bad practice to start from scratch like that? In my view it makes more sense, but I don’t want to have what is considered badly-writen code..?
I understand that CButton, CEdit, etc are all conveniant classes that are easy to
Share
It is difficult to get all the nuances of a standard control, so if yours will be expected to fill the same role you should probably start from the standard.
Also the standard controls can be placed in a dialog and overridden later. A plain CWnd will need to be created explicitly.
On the other hand, overriding the way Microsoft designed a control to work can be maddening sometimes.
Unfortunately it’s a judgement call in the end. Every case will be different and it’s impossible to make a blanket recommendation.