且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

如何在VC ++ 6.0项目中使用DLL而不需要它的.h和.lib文件?

更新时间:2022-06-10 09:09:36

这是可能的,如果你只是有extern C函数。如果是这种情况,方法可以加载dll与 LoadLibrary ,然后导入每个函数与 GetProcAddress 当然你需要知道函数签名来创建一个正确声明的函数指针。使用类相反是几乎不可能的。

It is possible if you just have plain "extern C" functions. If this is the case the approach could be loading the dll with LoadLibrary, and then import each function with GetProcAddress, of course you need to know the function signature to create a properly declared function pointer. Using classes per contrary is almost impossible.