<div dir="ltr"><div><div><div>Yes, using third-party DLL with scilab does seem to be hard.<br><br>Two crucial things are not supported:<br><br> - All inputs to the function are passed by *reference*, not value, but often times DLL are build with inputs being passed by value<br>
</div>- Functions can not return a value.<br><br></div>IMHO these are very serious problems with the DLL integration. I couldn't use my DLL in scilab because of these issues. And the documentation on this topic is quite weak. Especially the always passing by reference part. That took me a few hours of debugging to realize that.<br>
<br></div>Ian<br></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Fri, Feb 21, 2014 at 7:31 PM, Chuox <span dir="ltr"><<a href="mailto:chuox.bece@gmail.com" target="_blank">chuox.bece@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Using a third-party DLL in SciLab might be tricky.<br>
I had a problem linking EPANET toolkit library, what i did was create a dll<br>
to call the epanet2.dll (the library form EPANET) and return the values in<br>
SciLab. Maybe is not the best solution and there is a better way, but i<br>
didn't find it.<br>
This is and example of how i did it:<br>
<br>
/////The C code/////<br>
#include <string.h><br>
#include "epanet2.h"<br>
int SetLinkValue(int *index, int *param, float *Val, int *errcode )<br>
{<br>
*errcode=ENsetlinkvalue(*index, *param, *Val);<br>
return (*errcode);<br>
}<br>
<br>
/////SciLab Code/////<br>
//Link the dll used to cal the external dll<br>
unSetLink=link(Ubicacion+"enlace.dll","SetLinkValue","c");<br>
<br>
//This return and error<br>
[err]=call("SetLinkValue",TubIndex,1,"i",0,2,"i",diametro,3,"r","out",[1,1],4,"i");<br>
<br>
<br>
<br>
--<br>
View this message in context: <a href="http://mailinglists.scilab.org/Scilab-users-Linking-DLL-from-MS-Visual-C-to-SciLab-tp4028800p4028813.html" target="_blank">http://mailinglists.scilab.org/Scilab-users-Linking-DLL-from-MS-Visual-C-to-SciLab-tp4028800p4028813.html</a><br>
Sent from the Scilab users - Mailing Lists Archives mailing list archive at Nabble.com.<br>
_______________________________________________<br>
users mailing list<br>
<a href="mailto:users@lists.scilab.org">users@lists.scilab.org</a><br>
<a href="http://lists.scilab.org/mailman/listinfo/users" target="_blank">http://lists.scilab.org/mailman/listinfo/users</a><br>
</blockquote></div><br></div>