How to get a satellite DLL module module handler? (visual studio C ++)

We have moved all our lines to resources (and satellite DLLs) for the MFC application. Right now, the main language is included in the EXE itself, so when I call LoadString (), I can just pass the handle to the exe module.

However, I need to do this general - how can I get the module descriptor in a general way and make sure that I load the strings from the satellite DLL, if necessary? We need to get the appropriate module for the currently loaded resource library. (or exe if in English)

The :: LoadString () method takes a handle as the first argument - and we just use the current exe handle.

Do I have to determine if I need to load the DLL, or Windows automatically does this for me. This is not clear from the documents I read.

This means that MFC does this automatically . How can i get this hmodule?

+3
source share
3 answers

After you have loaded the resource dll with LoadLibrary, you save it HMODULE(returns LoadLibrary) and pass it to the function LoadString(as well as other resource functions).

, DLL (.. ), LoadLibraryEx LOAD_LIBRARY_AS_DATAFILE, - , dll ( ).

+5

libray LoadLibrary (Ex)? , .

GetModuleHandle ( " " ).

+1

All Articles