Declare function (test DLL)

Started by Frank Brübach, July 13, 2024, 06:59:54 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Frank Brübach

Hello Charles,

Made a simple Test with an DLL Here Avengerbasic2.dll

and a factorial function in it but the declare function to Test the DLL doesn't Work I am doing Something wrong?

'
' problem with testing and calling a function for a dll
'
declare function dosome lib "Avengerbasic2.dll" () as sys
declare function recursivefactorial(byval n as integer) lib "Avengerbasic2.dll" () as sys
' line 5 not found as

'recursiveFactorial (ByVal n As Integer) As sys export

dosome

Print recursiveFactorial(4) ' 24 ''
Print recursiveFactorial(6) ' 720

Frank Brübach

#1
Update . Sorry load wrong File

'
' problem with testing and calling a function for a dll
'
declare function dosome lib "Avengerbasic2.dll" () as sys
declare function recursivefactorial lib "Avengerbasic2.dll" (int s) as sys

' missing or unloadable recursivefactorial

Solved! Sorry.. "recursiveFactorial" must be the Name of the function  exactly Like in my dll

'recursiveFactorial (ByVal n As Integer) As sys export

dosome

Print recursiveFactorial(4) ' 24 ''
Print recursiveFactorial(6) ' 720

All OK Here .. my mistake

I have missed one Capital Letter  F instead of f Example Works AS expected