alirakiyan
alirakiyan

Reputation: 428

What is "Module" in win32 API function GetModuleFileName or GetModuleHandle?

In win32 , in some cases we need a Module handle to perform some action. But I don't know what is a Module exactly. Help me please.

Upvotes: 7

Views: 2424

Answers (1)

Sandi Hrvić
Sandi Hrvić

Reputation: 221

Your program executes within virtual memory space created by the OS when the program is loading. The program itself and all of the dynamic link libraries loaded in the virtual memory space are called modules. The HMODULE, or HINSTANCE is the address within the virtual memory where the particular module is loaded. You can use GetModuleInstance() or LoadLibrary() API calls to get the handles.

Upvotes: 7

Related Questions