just built a DLL as per code below. When setting
Code: Select all
#BUILD_DLL = #False
Help file:
So to me this looks like the called function returns '0' (as per help) - now we have a situation where we don't know if the called proc failed (in my case we see the requester, so we know it's ok - but in other cases we will be in the dark).Return value
Returns the return-value of the called function or zero if the library does not contain a function with the given name.
I could give it a dummy return value <> '0' so it becomes testable again - or Fred could resolve this ambiguity in code... or at least the help could be updated to point this potential pitfall out to unsuspecting users (like me today)...
Is this a valid assessment or am I missing something here?
Code: Select all
#BUILD_DLL = #False
CompilerIf #BUILD_DLL
ProcedureDLL DLLRequester(Msg$)
MessageRequester("DLL Requester", Msg$)
EndProcedure
CompilerElse
EnableExplicit
#LibHandle = 1
Define Result
If OpenLibrary(#LibHandle, "InstallHelper.dll") ;;; Or OpenLibrary(0, "InstallHelper.so")
Result = CallFunction(#LibHandle, "DLLRequester", @"I've got to get a message to you ...")
If Result = 0
Debug "Call function failed"
EndIf
Else
Debug "Lib open failed"
EndIf
CompilerEndIf