从dll中导出一个类 [英] EXPort a class out of dll
问题描述
大家好,
我想让课程从外面进行访问。
我以前用这种方式,
EXP int egNonMemberFunction(LPTSTR lpData,DWORD dwReserved = 0);
但是使用对象函数的主要问题是,
如果我想要dll,我无法实现线程安全的dll我的模块同时使用不同的
。
============== ====================
如果我生成静态库[lib文件],我知道它可能。
但我不想将lib文件共享给所有工作空间因为
1>代码安全
2>避免过多的依赖转发
[像dll可能需要安装第三方工具来编译lib每次]
有没有办法从动态dll中输出一个类?
嗯,你有文档从DLL使用__declspec(dllexport) [ ^ ]。此外,Visual Studio
,在生成DLL
应用程序的框架时,提供了导出类的示例代码。
Hi all,
I want to make a class accessible from out side.
I have used this way before,
EXP int egNonMemberFunction( LPTSTR lpData, DWORD dwReserved = 0);
but the major problem of using function insted of object is,
I can't implement a thread safe dll if I want the dll to be used by different
part of my module at the same time.
==================================
I know its possible if I generate static library[lib file].
but I don't want to share a lib file to all work spaces because of
1> code security
2>to avoid too many dependency forwarding
[like the dll might need a 3rd party tool to be installed to compile the lib each time]
Is there any way to EXPort a class out of dynamic dll ?
Well, you have the documentation "Exporting from a DLL Using __declspec(dllexport)"[^]. Moreover,Visual Studio
, on generating the skeleton of aDLL
application, provides sample code for exporting classes.
这篇关于从dll中导出一个类的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!