Working with DLL in Servoy?
Help!!!
Working with DLL in Servoy?
Help!!!
Hi Felipe,
I have never used Servoy with DLL’s but I think the closest you can get is via https://www.servoyforge.net/projects/servoy-com .
Hope this helps.
Much thanks ROCLASI
What do you want to do with a DLL?
I need to call a dll in Servoy
Does the DLL do only processing or does it have a UI function?
There is a way to call a DLL from Java code (via JNI - Java Native Interface) and therefore from Javascript. But this is a lot of an effort.
For example see:
http://www.java-forums.org/advanced-java/2064-how-call-dll-java.html
Perhaps the functionality can be duplicated in a plugin (Java code)?
Calling JNI from JavaScript? Oh man. This sounds like a mad plan to me!
Better encapsulate this kind of stuff inside a plugin, yes.
Or use the COM plugin, it’s using Jacob which is making it easier…
Of course from a plugin! Javascript in Servoy to invoke it!
I wonder about JNA (Java Native Access project) - maybe a better choice.
JNA is easier. It’s the lib used in the BrowserSuite for various Native access.
But still you need a good understanding of how Native objects works, and it can be tricky with C++ Struct
For simple COM usage, Jacob is the way to go.
@Patrick:
Glad to hear you have used JNA. I have used JNI quite a lot over a several years now to interface MATLAB code that was compiled to Java then I interfaced to several c++ dlls using JNI for some complex (READ MATLAB complex) structures. Not easy to do and quite a lot of effort, iterations and testing.
If JNA can be a production quality tool then it would be a way to go.
In either case one needs to know the dll functions in order to provide a way to call them. I have not seen a generic way to extract the function names return values, types etc yet (e.g. likehttp://www.dependencywalker.com/). Therefore the dll to be used must have some information for the user to “use” (properly and legally of course).
Is there a real need to use dlls in Servoy (encapsulated within plugins) by users or is the feeling that duplicating the functionality in Javascript/Servoy is better for the long maintenance support? I understand that “common” well maintained dlls appear to save development time.
@Felipe
Does this help or or you convinces not to use the dll by now?