How to load a custom binary resource in a VC++ static library as part of a dll?

前端 未结 3 941
离开以前
离开以前 2020-12-01 04:42

I have custom binary resources (animated cursors) that would like to store as resources in a static lib in Visual Studio C++. It turns out that custom binary resources wi

3条回答
  •  再見小時候
    2020-12-01 05:35

    The Problem of @LihO answer is:

    The first parameter of FindResource is the ModuleID of the Module containing the resources. If this is set to NULL the function will search in created process (.exe), not the DLL.

    But how to get the HMODULE insinde a static LIB?

    • add a function / parameter, which will get the HMODULE from the DLL. The HMODULE / HINSTANCE (is the same) can be retrieved in DLLMain.
    • Try this GetCurrentModule

    Edit:

    See also: Add lib resource to a library

提交回复
热议问题