当前位置:编程学习 > wap >>

QT有无管理多个dll插件的机制,特别是当有多个dll时在工程中的使用?

比如我的Solution中有几个dll(例如分析数据的、读取管理配置文件的、解析协议的等)的功能模块工程,

然后在程序中的不同地方要用到上面的不同dll模块,我理想的方案就是,一开始就加载好了这些dll模块,然

后用ModuleCatalog的方式管理起来,当程序的某个地方需要用到此模块的时候,通过ModuleCatalog把相应的

模块取出来,而不是每次用的时候都需要类似QPluginLoader(dll路径)的方式得到dll再其使用里面的接口

。QT有类似像这种ModuleCatalog的方法吗?

谢谢各位的解答。 dll --------------------编程问答-------------------- QLibrary

The QLibrary class loads shared libraries at runtime.

An instance of a QLibrary object operates on a single shared object file (which we call a "library", but is also known as a "DLL"). A QLibrary provides access to the functionality in the library in a platform independent way. You can either pass a file name in the constructor, or set it explicitly with setFileName(). When loading the library, QLibrary searches in all the system-specific library locations (e.g. LD_LIBRARY_PATH on Unix), unless the file name has an absolute path. If the file cannot be found, QLibrary tries the name with different platform-specific file suffixes, like ".so" on Unix, ".dylib" on the Mac, or ".dll" on Windows and Symbian. This makes it possible to specify shared libraries that are only identified by their basename (i.e. without their suffix), so the same code will work on different operating systems. --------------------编程问答-------------------- --------------------编程问答-------------------- 你可以借鉴插件机制 --------------------编程问答--------------------
引用 3 楼 heksn 的回复:
你可以借鉴插件机制

你好,能说详细点吗?有没有链接可参考?谢谢。
补充:移动开发 ,  Qt
CopyRight © 2012 站长网 编程知识问答 www.zzzyk.com All Rights Reserved
部份技术文章来自网络,