I loaded multiple dlls using LoadLibrary in the NSIS script as part of my project. Because the other dlls are references of the main dll. After that how to call the function using GetProcAddress? Because i have loaded multiple DLLs.
Below is my code snippet:
!include LogicLib.nsh
Section
SetOutPath $InstDir
File testutil.dll
System::Call 'KERNEL32::LoadLibrary(t "$InstDir\Testutil.dll")p.r8 ?e'
System::Call 'KERNEL32::LoadLibrary(t "$InstDir\TestControls.dll")p.r8 ?e'
System::Call 'KERNEL32::LoadLibrary(t "$InstDir\TestDevice.dll")p.r8 ?e'
System::Call 'KERNEL32::LoadLibrary(t "$InstDir\loadtestdll.dll")p.r8 ?e'
Pop $7
${If} $8 P<> 0
MessageBox MB_OK 'Successfully loaded "$InstDir\testutil.dll" @ $8'
System::Call 'KERNEL32::GetProcAddress(pr8, m "IsTherePower")p.r9 ?e'
Pop $7
${If} $9 P<> 0
MessageBox MB_OK 'Successfully found "IsTherePower" @ $9'
${Else}
MessageBox MB_ICONSTOP 'Unable to find "IsTherePower", error $7'
${EndIf}
System::Call 'KERNEL32::FreeLibrary(pr8)'
${Else}
MessageBox MB_ICONSTOP 'Unable to load "$InstDir\testutil.dll", error $7'
${EndIf}
When I run this script, it is loading the DLL successfully. But It is not loading the function. Could you please help me to resolve the issue?
