💾 Archived View for blitter.com › apl-books › APLX50 › APLX-manual › www.microapl.com › apl_help › c… captured on 2024-08-25 at 04:08:23.
⬅️ Previous capture (2022-07-17)
-=-=-=-=-=-=-
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <HTML> <HEAD> <TITLE>OCX/ActiveX Controls and OLE Automation</TITLE> <META NAME="DESCRIPTION" CONTENT="APL language help page: OCX/ActiveX Controls and OLE Automation"> <META NAME="KEYWORDS" CONTENT="OLE,automation,OCX,ActiveX,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"><code>APLX Help</code></A> : <A HREF="ch_030.htm"><code>System Classes</code></A> : <A HREF="ch_030_080.htm"><code>OCX/ActiveX Controls and OLE Automation</code></A> </center> <center> [ <A HREF="ch_030_080_010.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>OCX/ActiveX Controls and OLE Automation</h1> </td> </tr> <tr> <td width="800" valign="top" colspan="2"> <hr> <p><i><b>Note: This section applies to Windows only</b></i></p> <p><i>APLX for Windows</i> supports OLE Automation (also known as just Automation, or COM), a powerful facility which allows your APLX functions to use external software and controls to enhance the functionality of your applications. There are three ways in which you can use this feature:</p> <p>(a) You can place external <A HREF="ch_030_080_010.htm">OCX or ActiveX</A> controls directly on your APLX windows. For example, you can use the Formula One Excel-style spreadsheet 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> <p>In each case, you create an object using <code>⎕NEW</code> or <code>⎕WI</code>. This object will have properties, methods, and events which belong to the external software but which you can access just as you do with ordinary APLX objects. (To avoid any possible ambiguity, each external property, method, or event name is prefixed with an 'x', but you can omit this if you prefer.) </p> <H2>Properties supporting Automation</H2> <p>The System object has three properties which each return an N by 4 nested array of the external controls and servers installed on your system. These properties are:</p> <p><tt>xclasses</tt> OCX/ActiveX controls - case (a) above<BR> <tt>oledoctypes</tt> Document types which can be embedded in an OLEContainer - case (b) above<BR> <tt>oleclasses</tt> Server applications which you can invoke - case (c) above</p> <p>The returned array has one row for each external control or server installed (not all of these will necessarily be accessible). </p> <p>The first column is the plain text name, for example 'Chart FX'. The second column is an alphanumeric string enclosed in curly brackets, which is the unique ID of the automation object. The third column is the object class name, which is usually a period-delimited string giving the vendor name, object class name and optionally the version number, for example 'SoftwareFX.ChartFX.20'. (The fourth column is reserved for future use).</p> <p>You can use any of these as the class name to identify the control to APLX, but we recommend that you use the third.</p> <p>You can also use the Control Browser (on the Tools menu) to see the same information together with more detail on the properties, methods, events and constants exported by the control.</p> <hr> </td> </tr> <tr> <td width="800" valign="top" colspan="2"> <center>Topic: <A HREF="ch.htm"><code>APLX Help</code></A> : <A HREF="ch_030.htm"><code>System Classes</code></A> : <A HREF="ch_030_080.htm"><code>OCX/ActiveX Controls and OLE Automation</code></A> </center> <center> [ <A HREF="ch_030_080_010.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>