Difference between CDialog and CDialogEx

ⅰ亾dé卋堺 提交于 2019-12-05 11:09:32

CDialogEX is derived from CDialog, so, setting m_pMainWnd to a CDialogEx derived object should not be a problem. CDialogEx provides the abillity to set the background color or image of the dialog.

CDialogEX is used for setting background color, background images on dialog, If you want to set background images or color then your class will be derived from CDialogEX,but keep in mind If you are using CDialaogEX then you should use method of that class like CreateEX,If you are trying to derive class from CDilaogEX and use CDialog Method,then you will got Error..

sergiol

I had a case where a menu button was not working properly and the MFC source code recommended to replace CDialog by CDialogEx:

CMFCMenuButton does not close

And after I did it, everything worked right!

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!