💾 Archived View for blitter.com › apl-books › APLX50 › APLX-manual › www.microapl.com › apl_help › c… captured on 2023-01-29 at 14:37:58.
⬅️ Previous capture (2022-07-17)
-=-=-=-=-=-=-
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <HTML> <HEAD> <TITLE>Overview of interfacing to other languages</TITLE> <META NAME="DESCRIPTION" CONTENT="APL language help page: Overview of interfacing to other languages"> <META NAME="KEYWORDS" CONTENT="auxiliary processors, C, external functions, DLLs, shared variables,workspace entry, data format, imported routines, bundles, shared libraries,apl,aplx,apl help"> <!-- %%COMMON_HEAD%% --> <META http-equiv="Content-Type" content="text/html; charset=utf-8"> <LINK rel="stylesheet" type="text/css" href="http://www.microapl.com/styles_apl_help.css"> <!-- %%END%%--> </HEAD> <body> <table> <tr> <td width="800" valign="top" colspan="2"> <center>Topic: <A HREF="ch.htm">APLX Help</A> : <A HREF="ch_070.htm">Interfacing to other languages</A> : <A HREF="ch_070_010.htm">Overview of interfacing to other languages</A> </center> <center> [<A HREF="ch_070_020.htm">Next</A> | <A HREF="ch.htm">Contents</A> | <A HREF="help_index.htm">Index</A> | <A HREF="http://www.microapl.co.uk/apl/index.html">APL Home</A> ]</center> <br></td> </tr> <tr> <td width="120"> <a href="http://www.microapl.co.uk/apl/index.html"><img height="68" border="0" width="119" src="MicroAPL_logo.gif" alt="www.microapl.co.uk"></a> </td> <td align="left" valign="bottom"> <h1>Overview of interfacing to other languages</h1> </td> </tr> <tr> <td width="800" valign="top" colspan="2"> <hr> <H2>Interfacing to .Net, Java, and other object-oriented software</H2> <p>APLX allows you to use classes written in modern object-oriented languages such as the .Net languages (C#, Visual Basic, and other languages which generate code for the .Net Common Language Runtime), Java, and Ruby, and also the R statistical language. You can create and use instances of external classes, call 'static' (shared) methods, and in some cases evaluate statements in the external language directly. See the next section on <A HREF="ch_070_020.htm">Using External Classes</A> for full details.</p> <H2>Interfacing to procedural languages and shared libraries</H2> <P>APLX includes two main facilities for calling external procedural (i.e. not object-oriented) code from within APL, for example operating-system libraries (DLLs) or code written in C. These are: <ul><li>The <A HREF="ch_020_070_455.htm"><code>⎕NA</code> system function</A>, which allows you to define 'external functions' (i.e. calls to shared libraries or DLLs) and call them directly from APL</li></ul> <ul><li>The Auxiliary Processor (shared variable) mechanism, which allows you to interface to custom code written in C or other low-level languages. The details of writing an Auxiliary Processor are discussed in a <A HREF="ch_070_100.htm">later section</A>. See the <A HREF="ch_020_070_730.htm"><code>⎕SVO</code> system function</A> for more information on using auxiliary processors </li></ul> </P> <P> The choice between these two mechanisms depends on what you are trying to do. To interface to an existing shared library or DLL, or to call the operating system directly, <code>⎕NA</code> is usually the better choice. To write a full-featured sub-system which provides extensive functionality to APLX, the auxiliary processor mechanism may be preferred.</p> <H2>Interfacing via OLE and OCX (<i>Windows only)</i></H2> <p>Under Windows, Microsoft provide a generalized means for interfacing to external applications and using external controls. This mechamism is variously known as OLE, OCX, ActiveX, and COM. Although to some extent it has been superseded by the .Net architecture, it remains important because it is supported by a wide range of software. There are three ways in which you can use this feature:</p> <blockquote> <p>(a) You can place external <A HREF="ch_030_080_010.htm">OCX or ActiveX</A> controls directly on your APLX user-interface windows. For example, you can use an Adobe<sup>®</sup> Acrobat<sup><small>TM</small></sup> control as though it were a built-in APLX control. This is done simply by creating a window and then creating an external control on it.</p> <p>(b) You can embed <A HREF="ch_030_080_020.htm">OLE (Object Linking and Embedding) documents</A> in your windows. For example, you could include a Microsoft Word document as part of a more complex window, merging the Word menus and toolbar with your own. To allow this, APLX includes a control called an 'OLEContainer' which you place on your window. You can then specify the document to be embedded or linked, or allow the user to select one.</p> <p>(c) You can invoke and exchange data and commands with external <A HREF="ch_030_080_030.htm">OLE Server Applications</A>. This is somewhat similar to (b), but the application runs independently of APLX and is not embedded in one of your windows. For example, you could invoke Excel, cause it to load a spreadsheet, and extract the data from the spreadsheet as an APL nested array, without the user being involved.</p> </blockquote> <p>See the section on <A HREF="ch_030_080.htm">OCX/ActiveX Controls and OLE Automation</A> in the separate manual <i>APLX System Classes and User-Interface Programming</i> for full details.</p> <hr> </td> </tr> <tr> <td width="800" valign="top" colspan="2"> <center>Topic: <A HREF="ch.htm">APLX Help</A> : <A HREF="ch_070.htm">Interfacing to other languages</A> : <A HREF="ch_070_010.htm">Overview of interfacing to other languages</A> </center> <center> [<A HREF="ch_070_020.htm">Next</A> | <A HREF="ch.htm">Contents</A> | <A HREF="help_index.htm">Index</A> | <A HREF="http://www.microapl.co.uk/apl/index.html">APL Home</A> ]</center> <br></td> </tr> </table> <!-- %%COMMON_BODY_TAIL%% --> <p class="copyright">Copyright © 1996-2010 MicroAPL Ltd</p> <!-- %%END%% --> </body> </html>