# Working with DLL in Servoy?

**URL:** <https://forum.servoy.com/t/working-with-dll-in-servoy/15697>\
**Category:** Classic Servoy\
**Created:** [March 20, 2012, 2:31pm UTC](https://forum.servoy.com/t/working-with-dll-in-servoy/15697 "2012-03-20T14:31:41Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![felipebortoli017](https://avatars.discourse-cdn.com/v4/letter/f/c57346/32.png) [@felipebortoli017](https://forum.servoy.com/u/felipebortoli017)\
**Post date:** [March 20, 2012, 2:31pm UTC](https://forum.servoy.com/t/working-with-dll-in-servoy/15697/1 "2012-03-20T14:31:41Z")

</div>

Working with DLL in Servoy?

Help!!!

---

<div class="post-metadata">

**Author:** ![ROCLASI](https://yyz2.discourse-cdn.com/flex010/user_avatar/forum.servoy.com/roclasi/32/4371_2.png) [@ROCLASI](https://forum.servoy.com/u/ROCLASI)\
**Post date:** [March 20, 2012, 2:50pm UTC](https://forum.servoy.com/t/working-with-dll-in-servoy/15697/2 "2012-03-20T14:50:16Z")

</div>

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](https://www.servoyforge.net/projects/servoy-com) .

Hope this helps.

---

<div class="post-metadata">

**Author:** ![felipebortoli017](https://avatars.discourse-cdn.com/v4/letter/f/c57346/32.png) [@felipebortoli017](https://forum.servoy.com/u/felipebortoli017)\
**Post date:** [March 20, 2012, 2:57pm UTC](https://forum.servoy.com/t/working-with-dll-in-servoy/15697/3 "2012-03-20T14:57:35Z")

</div>

Much thanks ROCLASI

---

<div class="post-metadata">

**Author:** ![tparry](https://avatars.discourse-cdn.com/v4/letter/t/ecccb3/32.png) [@tparry](https://forum.servoy.com/u/tparry)\
**Post date:** [March 20, 2012, 3:15pm UTC](https://forum.servoy.com/t/working-with-dll-in-servoy/15697/4 "2012-03-20T15:15:02Z")

</div>

What do you want to do with a DLL?

---

<div class="post-metadata">

**Author:** ![felipebortoli017](https://avatars.discourse-cdn.com/v4/letter/f/c57346/32.png) [@felipebortoli017](https://forum.servoy.com/u/felipebortoli017)\
**Post date:** [March 20, 2012, 4:14pm UTC](https://forum.servoy.com/t/working-with-dll-in-servoy/15697/5 "2012-03-20T16:14:29Z")

</div>

I need to call a dll in Servoy

---

<div class="post-metadata">

**Author:** ![tparry](https://avatars.discourse-cdn.com/v4/letter/t/ecccb3/32.png) [@tparry](https://forum.servoy.com/u/tparry)\
**Post date:** [March 21, 2012, 1:46pm UTC](https://forum.servoy.com/t/working-with-dll-in-servoy/15697/6 "2012-03-21T13:46:54Z")

</div>

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](http://www.java-forums.org/advanced-java/2064-how-call-dll-java.html)  
Perhaps the functionality can be duplicated in a plugin (Java code)?

---

<div class="post-metadata">

**Author:** ![ptalbot](https://yyz2.discourse-cdn.com/flex010/user_avatar/forum.servoy.com/ptalbot/32/4952_2.png) [@ptalbot](https://forum.servoy.com/u/ptalbot)\
**Post date:** [March 21, 2012, 4:58pm UTC](https://forum.servoy.com/t/working-with-dll-in-servoy/15697/7 "2012-03-21T16:58:56Z")

</div>

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…

---

<div class="post-metadata">

**Author:** ![tparry](https://avatars.discourse-cdn.com/v4/letter/t/ecccb3/32.png) [@tparry](https://forum.servoy.com/u/tparry)\
**Post date:** [March 21, 2012, 6:18pm UTC](https://forum.servoy.com/t/working-with-dll-in-servoy/15697/8 "2012-03-21T18:18:51Z")

</div>

Of course from a plugin! Javascript in Servoy to invoke it!

I wonder about JNA (Java Native Access project) - maybe a better choice.

---

<div class="post-metadata">

**Author:** ![ptalbot](https://yyz2.discourse-cdn.com/flex010/user_avatar/forum.servoy.com/ptalbot/32/4952_2.png) [@ptalbot](https://forum.servoy.com/u/ptalbot)\
**Post date:** [March 21, 2012, 6:53pm UTC](https://forum.servoy.com/t/working-with-dll-in-servoy/15697/9 "2012-03-21T18:53:28Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![tparry](https://avatars.discourse-cdn.com/v4/letter/t/ecccb3/32.png) [@tparry](https://forum.servoy.com/u/tparry)\
**Post date:** [March 21, 2012, 7:46pm UTC](https://forum.servoy.com/t/working-with-dll-in-servoy/15697/10 "2012-03-21T19:46:38Z")

</div>

@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? ![:)]( "Smile")
