简体   繁体   中英

Loading a third party dll in visual c++/qt application

I have third party dlls that I need to use with my application. The interface is defined in the third party dlls and I have to make the interface call from my application. I have the function prototype of the interface, but no lib files or header files. It looks like loadlibrary should be used, but is it possible without the header files ? Is there a way to generate such header files? Would also greatly appreciate some explanation for the loadlibrary, as I am still grasping the idea yet. Thanks!

您可以使用QLibrary :: resolve() (或其静态便利兄弟)在DLL中查找符号并调用它。

You load the library with the API function LoadLibrary . After loading the DLL you use GetProcAddress to get the entry point for a specific function.

If it's a C++ library, you may have to care for the decorated names. The tools dumpbin and undname may help to identify what is really exported by the DLL.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM