MFC:从 GUI 中删除元素
在修补和修改 GUI 之后,我已经工作了一段时间,最终得到了一组我不再需要的 EditController 和单选按钮,所以我想摆脱它们。但是,如果我只是从 GUI 编辑中删除它们,则会出现断言错误。我该如何摆脱这些元素?
After tinkering and modifying a GUI I have been working on for some time I ended up with a group of EditControllers and Radio Buttons that I do not need any more, so I would like to get rid of them. However, if I simply delete them from the GUI edit, I get assertion errors. How am I supposed to get rid of these elements?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您需要从程序中删除引用已删除控件的所有代码。对于要删除的每个控件,获取其 ID 并在源中搜索引用它的语句。
You need to remove all code from your program that refers to the deleted controls. For each control you want to delete, take its ID and search the source for statements that refer to it.
像这样开始:
GetDlgItem
、DDX_Control
等)。删除或评论它们。删除适当的 CWnd 派生变量(例如 CEdit、CComboBox 等)。如果给定的 ID 被其他对话框使用(从资源视图的上下文菜单资源符号...中检查),则您无法直接从资源编辑器中删除它。但是,您需要从适当的实现文件(
CDialog
/CPropertyPage
派生类的)中删除它。Start like this:
GetDlgItem
,DDX_Control
etc). Remove or comment them. Remove appropriateCWnd
-derived variables (likeCEdit
,CComboBox
etc).If given ID is used by other dialogs (check it from Resource View's context menu Resource Symbols...), then you cannot directly remove it from resource editor. You, however, need to remove it from appropriate implementation file (of
CDialog
/CPropertyPage
-derived class).