WTL界面问题
==================================================
1、setwindowpos()
中主窗体坐标系从左上(0,0)开始
移动控件位置时不要忘记转换控件坐标系为对话框的相对坐标(screentoclient(rect)
)
2、添加CustomCtrl
定制控件后对话框未弹出的问题:要在构造函数中registerclass
,以及控件属性界面设置class为需要的类型如:Listctrl、Edi
t等等
3、An unsupported operation was attempted“ 有时候DDX报错可能是资源id的问题, 或者在对话框初始化中没有给赋值
http://www.cppblog.com/flyingxu/archive/2006/05/31/7963.html
https://stackoverflow.com/questions/42729770/mfc-ddx-radio-causes-debug-assertion-failure-when-dodataexchange-is-called-dlgd
DDX_RADIO
:
The problem is, that the auto radio button stuff in Windows skips buttons that are disabled. In detail. You click on button 2 while button 3 is selected and disabled. Button 2 gets selected but button 3 is not unchecked.
The next problem occurs when DoDataExchange
runs. It doesn’t check if a button is enabled or disabled. DDX_Radio just loops over all radio buttons, and it find 2 buttons in the group are enabled. This causes the ASSERT. DDX_Radio don’t care if a button is enabled or disabled.
My advice: Use a custom OnClick
handle by yourself, and disable all other buttons manually.
设置group