MFC 对话框资源可以附加到 CChildView 吗? [英] Can a MFC dialog resource be attached to a CChildView?

查看:49
本文介绍了MFC 对话框资源可以附加到 CChildView 吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个单文档 MFC 应用程序,它由 MainFrame(派生自 CFrameWnd)和包含的 CChildView(派生自 CWnd)组成.这些是由 VS MFC 向导生成的.

I have a single document MFC app, which consists of the MainFrame (derived from CFrameWnd) and within contained CChildView (derived form CWnd). These are generated by the VS MFC Wizard.

在资源编辑器中,我设计了一个简单的 UI 并将其标记为 IDD_CUSTOMCONTROL,其中包含几个按钮和文本字段.我想将它连接到 CChildView 而不将其生成为新对话框.

In resource editor I have designed a simple UI and tagged it as IDD_CUSTOMCONTROL with few buttons and text fields. I would like to connect it to the CChildView without generating it as a new dialog.

正确的做法是什么?有可能做到吗?还是应该将 ID 直接连接到 MainFrame?

What is the right way to do it? Is it possible to do it? Or should I connect the ID directly to MainFrame?

我刚刚找到了正确的 MSDN 页面说明哪些类可以分配对话 id.

I have just found the right MSDN page which states which classes can have dialog id's assigned.

问题的范围已用完.可以/应该关闭吗?或者我可以问如何实现我的目标并将设计的资源应用于 MainFrame?(标题现在具有误导性).

The scope of the question is depleted. Can/should it be closed? Or can I ask how to achieve my goal and apply the designed resource to MainFrame? (The title is now misleading).

推荐答案

简而言之:没有

我刚刚找到了正确的 MSDN 页面,其中指出类可以分配对话 id.

I have just found the right MSDN page which states which classes can have dialog id's assigned.

CButtonCWndCDocument 等类,它们不需要对话 ID 或资源 ID.这些类不使用对话框或资源标识.如果您为基类选择这些类之一,对话框 ID 框和 DHTML 资源 ID 框变暗.

Classes such as CButton, CWnd, or CDocument, which do not require a dialog ID or resource ID. These classes do not use a dialog or resource ID. If you select one of these classes for your base class, the Dialog ID box and the DHTML resource ID box are dimmed.

CDialogCFormViewCPropertyPage 等类,要求对话框 ID.

Classes such as CDialog, CFormView, or CPropertyPage, which require a dialog ID.

CDHtmlDialog 类,它需要一个对话框 ID,一个 DHTML 资源ID 和 HTML 文件名.

The class CDHtmlDialog, which requires a dialog ID, a DHTML resource ID, and an HTML file name.

我应该使用 CFormView 而不是@ConstantineGeorgiou 在评论中提出的.

I should go with CFormView instead as @ConstantineGeorgiou proposed in comments.

这篇关于MFC 对话框资源可以附加到 CChildView 吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆