Basic: GetModuleHandle / LoadString / Resource Embed

1. For a native C++ project in VS, once you create resource.h + res file in the project, you can manually add resources (forget about the stupid resource editor!). By default, the resources will be embedded into the module. Usually, we create separate resource dll to hold all resources.

2. Loading resource: firstly you need to get the handle of the module (dll, exe) where contains the resources. GetModuleHandle helps on this; and then LoadXX functions can help to load back the resource you want by inputting module handle, resID, etc. 

Note: we are so used to getting module handle easily from MS dllMain like mechanism. In other cases, for example developing objectArx app, we need to get back the module handle by GetModuleHandle("strAddinName.arx").

原文链接: https://www.cnblogs.com/taoxu0903/archive/2010/08/30/1812655.html

欢迎关注

微信关注下方公众号,第一时间获取干货硬货;公众号内回复【pdf】免费获取数百本计算机经典书籍

    Basic: GetModuleHandle / LoadString / Resource Embed

原创文章受到原创版权保护。转载请注明出处:https://www.ccppcoding.com/archives/14488

非原创文章文中已经注明原地址,如有侵权,联系删除

关注公众号【高性能架构探索】,第一时间获取最新文章

转载文章受原作者版权保护。转载请注明原作者出处!

(0)
上一篇 2023年2月7日 下午2:08
下一篇 2023年2月7日 下午2:09

相关推荐