如何使用dll覆盖CFrameWnd [英] How do I override CFrameWnd using a dll

查看:89
本文介绍了如何使用dll覆盖CFrameWnd的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述





我有一个MFC应用程序,它将MFC dll作为插件加载。



现在,我想使用这个dll为应用程序的FrameWnd添加一些新方法。



我只能通过指向它的指针访问框架窗口:



CFrameWnd * pFrameWnd =(CFrameWnd *)pWnd;





我在dll中创建了一个CFrameWnd驱动类(CMyFrameWnd),现在我想将应用程序的CframeWnd类更改为这个新课程在运行时动态。



有没有办法做到这一点?



或者,有没有办法使用DLL为应用程序的CFrameWnd添加一些新方法?



谢谢,

Mochenoo

Hi,

I have an MFC application that load an MFC dll as a plugin.

Now, I want to add some new methods to the FrameWnd of the appication using this dll.

I can access to the frame window only with a pointer to it:

CFrameWnd* pFrameWnd = (CFrameWnd*)pWnd;


I have create a CFrameWnd driven class (CMyFrameWnd )in the dll and now I want to change the CframeWnd class of the application to this new class dynamically at run time.

Is there any way to do this?

Or, Is there any way to add some new methods to CFrameWnd of application using dll?

Thanks,
Mochenoo

推荐答案

整个想法都是错误的。你有一些误解,并试图根据它提出一个实施问题。建议只有一个:学习编程基础知识和OOP。另请参阅我对此答案的评论:

CframeWnd在运行时动态自定义CFrameWnd [ ^ ]。



再次,请记住,由于明显的原因,重新发布被视为滥用。你的回答不够,只是因为我对这个问题更合理的想法的关注。事实并非如此。 :-)



而不是重新发布,在评论中进行对话并尝试修改问题;它会把它放回问题列表的顶部。



-SA
The whole idea is wrong. You got some misconception and trying to ask an implementation question based on it. The advice is only one: learn programming fundamentals and OOP. See also my comments to this answer:
CframeWnd to custom CFrameWnd dynamically at Runtime[^].

And again, remember that re-posts are considered as abuse, by apparent reasons. You got inadequate answer just because my preoccupation with the idea that the question was more reasonable. Which wasn't the case. :-)

Instead of re-posting, do the dialogs in comments and try to modify the question; it will put it back to the top of question list.

—SA


这篇关于如何使用dll覆盖CFrameWnd的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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