开发者

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

I have third party dlls that I need to use with my applic开发者_如何转开发ation. 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!


You can use QLibrary::resolve() (or its static convenience brethren) to lookup a symbol in a DLL, and call it.


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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜