在其他计算机上运行包含 MFC 类的 Dll C++
我制作了一个普通的 dll(不是 MFC dll),并且在那里使用 CImage 类(MFC)并且它工作得很好。 首先,我在 dll 方面没有太多经验,所以我想知道如果我不使用“MFC Dll”选项,我的 dll 将如何工作,以及这两个选项之间有什么区别。
我的第二个问题是,如果我在其他一些装有 Windows 操作系统的计算机上运行我的 dll,那么我使用 CImage 类(MFC)是否会出现问题,或者在每台装有 Windows 操作系统的计算机上运行它不会有问题?
我认为如果我使用 CImage 类,我的 dll 的大小将会由于添加的其他类而增加(顺便说一下,它添加了所有 MFC 类还是仅添加了 CImage 类?) 因此我不会在运行我的 dll 的计算机上进行转发,但我根本不确定。
感谢您的时间和帮助!
I've made a normal dll (not a MFC dll) and I use there CImage Class (MFC) and it works great.
First of all I dont have lot of experience in dlls, so I wonder how my dll works if i didn't used the "MFC Dll" option, and whats the difference between the two options.
My second question is if the fact that I am using the CImage class (MFC) can make problems if I run my dll on some other computers with windows operation system or there will be no problem running it on every computer with windows operation system?
I think that if I am using the CImage class my dll's size will grow due to the additional classes that is being added (by the way, it adds all the MFC classes or only the CImage one?)
and therefore I don't relay on the computer that run my dll, but I am not sure at all.
Thank you for the time and the help!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
MFC DLL 更像是一个 DLL 向导,如果您要遵循 MFC 框架使用指南,它会为您设置一些样板代码。并不是绝对需要能够使用 MFC。您仍然可以创建自己的代码并根据需要使用它。
对于 MFC 跨机器可移植性,当您静态链接到 MFC(Release 版本中的默认设置)时,它是透明的,但如果您动态链接到 MFC(调试),则应确保目标计算机上存在相应的 MFC dll 库建造)。
虽然 MFC 是一个相当大的框架,有其优点和缺点,但使用其单一、单独的功能并不常见,也许您应该考虑其他解决方案,例如 http://openil.sourceforge.net 用于处理图像,无需框架的所有负担。
MFC DLL is more a DLL wizard that sets some boilerplate code for you if you are going to follow the MFC framework usage guidelines. It is not absolutely necessary to be able to use MFC. You may still create your own code and use it as you wish.
As it comes to MFC cross-machine portability, it is transparent when you link to MFC statically (default setting in Release build) but you should ensure that the corresponding MFC dll library is present on the target machine if you link to MFC dynamically (Debug build).
While MFC is a quite big framework with its good and bad sides using its single, separate features is not a common practice and maybe you should consider other solution like http://openil.sourceforge.net for handling images without all the burden of a framework.