<html>
  <head>

    <meta http-equiv="content-type" content="text/html; charset=ISO-8859-15">
    <style type="text/css">
        /* Quote Levels Colors */
        blockquote.cite {    color: navy !important; background-color: RGB(245,245,245) !important;
        }
        blockquote.cite blockquote.cite {    color: maroon !important; background-color: RGB(235,235,235) !important;
        }
        blockquote.cite blockquote.cite blockquote.cite {    color: green !important; background-color: RGB(225,225,225) !important;
        }
        blockquote.cite blockquote.cite blockquote.cite blockquote.cite {    color: purple !important; background-color: RGB(215,215,215) !important;
        }
        blockquote.cite blockquote.cite blockquote.cite blockquote.cite blockquote.cite {    color: teal !important; background-color: RGB(205,205,205) !important;
        } 
</style>
  </head>
  <body>
    I checked a very simple approach in MSVC (VS 2010):<br>
    <br>
    #include "stdafx.h"<br>
    #include <api_scilab.h><br>
    #include <call_scilab.h><br>
    <br>
    <br>
    int APIENTRY _tWinMain(HINSTANCE hInstance,<br>
                         HINSTANCE hPrevInstance,<br>
                         LPTSTR    lpCmdLine,<br>
                         int       nCmdShow)<br>
    {<br>
        if (!StartScilab(NULL,NULL,NULL))<br>
         {MessageBox(0,L"failed to start Scilab",L"Error:",MB_ICONHAND);<br>
          return 0;<br>
         }<br>
        DisableInteractiveMode();<br>
    <br>
        if (0!=SendScilabJob("a=10;")) MessageBox(0,L"Error sending
    job",L"Error:",MB_ICONHAND);<br>
         <br>
        TerminateScilab(NULL);<br>
        return 0;<br>
    }<br>
    <br>
    To compile that, modules\core\includes, modules\call_scilab\includes
    and modules\api_scilab\includes need to be in your include path, and
    you should link against call_scilab.lib and api_scilab.lib, which
    are in the bin folder. The bin folder needs to also be in the path
    when you call the exe, as this is where the corresponding dlls are
    located.<br>
    <br>
    Hope that helps,<br>
    <br>
    Best wishes, <br>
    <br>
    Jasper.<br>
    <br>
    On 4/10/2012 19:44, Mikhail Matusov wrote:
    <blockquote class=" cite"
      id="mid_121E88BE29EF42D9A5075EA19B62916B_SPCI055"
      cite="mid:121E88BE29EF42D9A5075EA19B62916B@SPCI055" type="cite">
      <meta content="text/html; charset=ISO-8859-15"
        http-equiv="Content-Type">
      <div dir="ltr">
        <div style="FONT-FAMILY: 'Calibri'; COLOR: #000000; FONT-SIZE:
          12pt">
          <div>Hello Jasper,</div>
          <div> </div>
          <div>I was wondering if you could help me with the call_scilab
            example? Could you please describe how you got it working?
            What C compiler are you using? In which environment?</div>
          <div> </div>
          <div> </div>
          <div>Thanks,</div>
          <div>/Mikhail</div>
          <div> </div>
          <div> </div>
          <div style="FONT-STYLE: normal; DISPLAY: inline; FONT-FAMILY:
            'Calibri'; COLOR: #000000; FONT-SIZE: small; FONT-WEIGHT:
            normal; TEXT-DECORATION: none">
            <div style="FONT: 10pt tahoma">
              <div> </div>
              <div style="BACKGROUND: #f5f5f5">
                <div style="font-color: black"><b>From:</b> <a
                    moz-do-not-send="true" title="jasper@amsterchem.com"
                    href="mailto:jasper@amsterchem.com">jasper van baten</a>
                </div>
                <div><b>Sent:</b> Tuesday, April 10, 2012 1:10 PM</div>
                <div><b>To:</b> <a moz-do-not-send="true"
                    title="users@lists.scilab.org"
                    href="mailto:users@lists.scilab.org">users@lists.scilab.org</a>
                </div>
                <div><b>Subject:</b> Re: [scilab-Users] API_Scilab
                  example</div>
              </div>
            </div>
            <div> </div>
          </div>
          <div style="FONT-STYLE: normal; DISPLAY: inline; FONT-FAMILY:
            'Calibri'; COLOR: #000000; FONT-SIZE: small; FONT-WEIGHT:
            normal; TEXT-DECORATION: none">Hello Sylvestre, <br>
            <br>
            I see the call_scilab example, which works fine. <br>
            <br>
            I would like an example of scilab calling a function
            implemented in C++. <br>
            <br>
            I have read the documentation, but I am apparently missing
            the example. Would you be so kind to post the URL of the
            example itself?<br>
            <br>
            Thank you again, <br>
            <br>
            Best wishes, <br>
            <br>
            Jasper.<br>
            <br>
            On 4/10/2012 18:07, Sylvestre Ledru wrote:
            <blockquote class=" cite"
              id="mid_1334074041_10059_4_camel_pomegues_inria_fr"
              cite="mid:1334074041.10059.4.camel@pomegues.inria.fr"
              type="cite">
              <pre wrap="">Hello,

You will find all the information and example in the api_scilab
documentation.
cf:
<a moz-do-not-send="true" class="moz-txt-link-freetext" href="http://help.scilab.org/docs/5.3.3/en_US/api_scilab.html">http://help.scilab.org/docs/5.3.3/en_US/api_scilab.html</a>

Sylvestre

Le mardi 10 avril 2012 à 14:58 +0200, jasper van baten a écrit :
</pre>
              <blockquote class=" cite" id="Cite_0" type="cite">
                <pre wrap="">Hello Sylvestre, 

Can you outline how to call a C (or C++)  function from Scilab? (what
intersci used to do...)

That is, suppose I have a C++ function Plus2:

double Plus2(double arg) {return arg+2.0;}

How can I use that from the Scilab command line?

Thanks,

Jasper.

On 4/10/2012 08:28, Sylvestre Ledru wrote: 
</pre>
                <blockquote class=" cite" id="Cite_1" type="cite">
                  <pre wrap="">Hello, 
On 10/04/2012 00:53, Mikhail Matusov wrote: 
</pre>
                  <blockquote class=" cite" id="Cite_2" type="cite">
                    <pre wrap="">Hi all, 
Can someone please point me to a simple example of how to use the
API_Scilab? I am looking for ability to call SciLab functions from
C, not the other way around. 

</pre>
                  </blockquote>
                  <pre wrap="">api_scilab should be used when you want to add new features into
Scilab based on C/C++ libraries. 
The documentation is here: 
<a moz-do-not-send="true" class="moz-txt-link-freetext" href="http://help.scilab.org/docs/5.3.3/en_US/api_scilab.html">http://help.scilab.org/docs/5.3.3/en_US/api_scilab.html</a> 

If you want to use Scilab as a computing enigne with C/C++, it is
here: 
<a moz-do-not-send="true" class="moz-txt-link-freetext" href="http://help.scilab.org/docs/5.3.3/en_US/call_scilab.html">http://help.scilab.org/docs/5.3.3/en_US/call_scilab.html</a> 
And from Java: 
<a moz-do-not-send="true" class="moz-txt-link-freetext" href="http://help.scilab.org/docs/5.3.3/en_US/javasci.html">http://help.scilab.org/docs/5.3.3/en_US/javasci.html</a> 

Sylvestre 




</pre>
                </blockquote>
              </blockquote>
            </blockquote>
            <p color="#000000" avgcert??="" align="left">No virus found
              in this message.<br>
              Checked by AVG - <a moz-do-not-send="true"
                href="http://www.avg.com">www.avg.com</a><br>
              Version: 2012.0.2126 / Virus Database: 2411/4926 - Release
              Date: 04/10/12</p>
          </div>
        </div>
      </div>
    </blockquote>
  </body>
</html>