How to get dll file name?

I have a C ++ Windows application myapp.exe that downloads several plugins.

Plugins must find the path to their dlls. I can use GetModuleFileName for this, but for this I need a handle for the plugin DLL. I do not know where to get this descriptor. GetModuleHandle (NULL) returns an executable file descriptor.

One option is to use GetModuleHandle (GetModuleHandle ("myplugin.dll"), but this requires the plugin name to be hard-coded, which I want to avoid.

Any help is appreciated.

Floor

+5
source share
1 answer

I do not know where to get this descriptor

DLLMain().

DLLMain(), VirtualQuery AllocationBase MEMORY_BASIC_INFORMATION HMODULE.

+10

All Articles