Hello,
I am writting a class derived from CWnd. However, I do not find a good point to start. I think that the simplest case is using CWnd to write a CButton. Has anyone done it or Do you know any resources for this problem.
Thank you very much!
Best,
I am writting a class derived from CWnd. However, I do not find a good point to start. I think that the simplest case is using CWnd to write a CButton. Has anyone done it or Do you know any resources for this problem.
Why not consider writing some not-yet-existing controls since MFC already has its own CButton class.
Well, the problem is understanding Windows and than MFC. What you wrote is a contradiction:
Use either CWnd oe CButton class to crete window you want.
You cannot use CWnd class to create CButton object.
CWnd class is used to create just about any window you want. You choose Window class from either: from Windows set of control classes or registering your own window class.
You can use CWnd class to create button window but MFC variety of wrappers, has CButton class (derived from CWnd) you can use.
If you want to use CWnd class to create button, pass button class name as parameter to CreateWindow or CreateWindowEx.
There are only 10 types of people in the world: Those who understand binary and those who do not.
Well, the problem is understanding Windows and than MFC. What you wrote is a contradiction:
Use either CWnd oe CButton class to crete window you want.
You cannot use CWnd class to create CButton object.
CWnd class is used to create just about any window you want. You choose Window class from either: from Windows set of control classes or registering your own window class.
You can use CWnd class to create button window but MFC variety of wrappers, has CButton class (derived from CWnd) you can use.
If you want to use CWnd class to create button, pass button class name as parameter to CreateWindow or CreateWindowEx.
Hello, I am sorry because using a wrong name. I used the word "CButton", which is not very appropriate. I mean deriving a class CMyButton from CWnd, which has almost all of the characteristics of CButton.
Thank you for your comments.
First thing to become a good programmer is learning how to translate your thoughts into terms everybody can understand; define common basic terms that can be used to carry a discussion knowing that we are talking about the same thing.
Having said so: Why not to use CButton class as a base class for CMyButton?
Is using CWnd as a base class for CMyButton an exercise?
There are only 10 types of people in the world: Those who understand binary and those who do not.
I can appreciate this, but in order to do so, I would suggest some reading about Windows programming and MFC.
Try creating Win32 application to get familiar with windows classes, main message loop, window procedure, windows messages and windows API.
Than try MFC that wraps most of the windows APIs.
I have attached sample project for starters.
There are only 10 types of people in the world: Those who understand binary and those who do not.
* The Best Reasons to Target Windows 8
Learn some of the best reasons why you should seriously consider bringing your Android mobile development expertise to bear on the Windows 8 platform.