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").

你可能感兴趣的:(resource)