ActiveX


 

Before reading this section it is advisable to have at least a basic knowledge of Microsoft ActiveX technology.  ActiveX is a framework for defining reusable software components (known as controls) that perform a particular function or a set of functions in a way that is independent of the programming language used to implement them. You can out find more details about ActiveX in the relevant section of MSDN - the “Microsoft Developer Network”.

Many Microsoft Windows applications; including many of those from Microsoft itself, such as Internet Explorer, Microsoft Office, Microsoft Visual Studio, and Windows Media Player; use ActiveX controls to build their feature-set and also encapsulate their own functionality as ActiveX controls which can then be embedded into other applications.  Internet Explorer also allows embedding ActiveX controls onto web pages.

ActiveX controls could be considered like small program building blocks which can serve creation of distributed applications, examples include customized applications for gathering data, viewing certain kinds of files, and displaying animation.

Eagle version 14 allows installation of ActiveX controls i a document window (gwindow) or as an option in a panel (usually a dialog bar).

First of all the ActiveX has an identifier (ProgID) that distinguishes registered controls and the developer uses this identifier to install the control in a document window:

Sample Code :

Create a gwindow that display the “Calendar” ActiveX

 

 gwin 2, pos = 100,100, w = 600, h = 600 ,t = 'activex here', progid = ' MSCAL.Calendar.7'

 

 

 

or alternatively in a button:

 

Sample Code :

Tab file entry for a panel that contains the “Calendar” ActiveX

 

 55,2,8,400,280,0,0,320,'MSCAL.Calendario.7':;

 

 

 

or alternatively in a button:

Sample Code :

Tab file for a panel that contains the “Calendar” ActiveX

 

 55,2,8,400,280,0,0,320,'MSCAL.Calendario.7':;

 

 

 

Secondly an ActiveX object is organized with interfaces that provide a set of functions with which the control can be managed.  Using an external Eagle utility tool (ActiveX2Eagle.exe) create series of command files (*.cmd) is created, also called an “Eagle Stubs Library”, which contains the properties and functions exposed by the selected ActiveX needed to control it from within Eagle..

In the “Command Prompt” we call the ActiveX2Eagle executable specifying both the folder in which save the files and the ActiveX identifier using the following syntax:

Prototype :

 

 

 

ActiveX2Eagle              [destin.directory] [ActiveX ProgID]

 

For instance:

Sample Code :

Create Stubs files for the “Calendar” ActiveX

 

ActiveX2Eagle c:\calendar\ MSCAL.Calendar.7

 

 

 

The created command files can be called like any standard cmd file using the relevant parameters.

The first parameter is always the index of the ActiveX object, so in the case of a control inside a gwindow the index is the Eagle window  Id, instead of the option in a tab file the index is calculated using the following formula:

( panel_id  *  2**8 ) + button_id

The following table presents two examples to clarify how to use stubs functions :