GeorgeM
4 years agoNew Contributor
Use dll from C# class in Groovy Script
Hello there.
I am trying to call a function from a dll generated from a C# class.
I use the following script:
import com.sun.jna.Native
import com.sun.jna.Library
interface Hello extends Library {
String GregFunc()
}
def nativeLibraryC = Native.loadLibrary('TestSas', Hello.class)
def methods = nativeLibraryC.getClass().getDeclaredMethods()
for (method:methods) log.info(method);
def lala = nativeLibraryC.GregFunc()
log.info(lala)
GregFunc() normaly should just return a string.
The problem is that even though library is loaded i get an error message that GregFunc() cannot be found.
Can anyone help?