一个MFC对话框可以具有多个用于接收和发送事件的对话框类吗 [英] Can One MFC dialog have multiple dialog classes for receving and sending events

查看:84
本文介绍了一个MFC对话框可以具有多个用于接收和发送事件的对话框类吗的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好

我是MFC应用程序开发人员.

I am MFC application developer.

在我的代码中有一种情况,一个MFC对话框应该具有两个类,并且根据情况,同一对话框应该附加到其中一个类上,以接收事件或将事件发送给calss.

I have one situation in my code where one MFC dialog should have two classes and depending on situation same dialog should get attached to one of the class to receive or send events to calss.

在MFC C ++应用程序中可以吗?

Can it be possible in MFC C++ application ?

预先感谢.

推荐答案

在我的代码中有一种情况,其中一个MFC对话框应具有两个类,并且根据情况,应将同一对话框附加到其中一个类上,以接收事件或将事件发送给calss.

在MFC C ++应用程序中可以吗?

I have one situation in my code where one MFC dialog should have two classes and depending on situation same dialog should get attached to one of the class to receive or send events to calss.

Can it be possible in MFC C++ application ?

从理论上讲,我不知道为什么不可以,因为对话框资源ID可能是
传递给构造函数中的包装器类.

In theory, I don't see why not as the dialog resource ID could be
passed to the wrapper class in the constructor.

使用设计器执行此操作时可能会遇到问题.

You might have issues using the designer to do it.

我会尝试通过让基类使用以下所有通用代码来实现该功能:
在派生类中完成的特定行为.

I'd try to do it by having a base class do all the common code with
specific behaviour done in derived classes.

戴夫


这篇关于一个MFC对话框可以具有多个用于接收和发送事件的对话框类吗的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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