Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
是否可以有一个没有 DLLMain 函数的 DLL?这会产生什么影响,或者它会使 DLL 无法使用?
当然,可以有一个没有 DLLMain 的 DLL。但它与普通的 DLL 不同。
例如,资源 DLL 不需要有代码。
在 Visual Studio 中,您可以使用 /NOENTRY 选项,这样链接器就不会抱怨缺少引用。
从所有规范的角度来看,该文件是一个完整的 DLL。
是的,您可以仅加载带有资源的 DLL 库,为此,请使用带有 LOAD_LIBRARY_AS_IMAGE_RESOURCE 的 LoadLibraryEx()。