VC++ resources in a static library

前端 未结 7 1952
天涯浪人
天涯浪人 2020-11-29 21:30

Is it possible to build resources into a static library and reuse them by simply linking with the library?

I\'m primarily thinking about the case where you call a fu

相关标签:
7条回答
  • 2020-11-29 22:24

    I don't think so. Static library doesn't have it's own HINSTANCE. It's code is executed in the context of DLL or EXE which links it. That's why all the resources you'll try to load from the static library's code will be of that enclosing DLL/EXE.

    I did that kind of resources reuse with a DLL though, as far as it has it's own address space, and you can call LoadResource with DLL's HINSTANCE.

    0 讨论(0)
提交回复
热议问题