LoadLibrary() and GetProcAddress() in C++

Опубликовано: 28 Сентябрь 2024
на канале: Snehal
9,350
71

Using this function you can call functions from other Library i.e. [DLL or EXE].

1) Create win32 DLL application, create one class and create one method into that class.
2) Create win32 EXE application,
a) Call LoadLibrary() function, this function takes path of DLL as input. This function returns HINSTANCE to loaded DLL if it successfully loaded.
b) Call GetProcAddress() function. This function takes HINSTANCE which is retured from LoadLibrary() function and name of the method which you want to call.
c) Create function pointer to hold address which is returned from GetProcAddress().

Let me know if you have any problem.