如何在DLL中导出类(使用LoadLibrary) [英] How to export class in DLL (using LoadLibrary)
本文介绍了如何在DLL中导出类(使用LoadLibrary)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
你好,
我使用LoadLibrary调用在DLL(在* .def文件中定义)中导出的函数,但是我想通过LoadLibrary(显式链接)导出整个类.我怎么能做到这一点.请帮帮我.
在此先感谢!
Hello,
I use LoadLibrary to call functions exported in a DLL (defined in *.def file), however I want to export an entire class through LoadLibrary (explicit linking). How can I achieve this. Please help me.
Thanks in advance!
推荐答案
我明白了,
可以通过将类函数设为虚拟来实现,
并将类头文件保存在我想要的类的exe文件中.
i got it ,
it can be done by making class function virtual,
and keeping class header file in exe file where i want class
如果使用显式链接,则无法导入类.
您到底想达到什么目的?
You can''t import classes if you use explicit linking.
What are you trying to achieve exactly ?
尝试使用MSDN进行研究;请参见此处 [
Try using MSDN for your research; see here[^] for a full discussion on building export libraries.
这篇关于如何在DLL中导出类(使用LoadLibrary)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文