Writing IOX Plugins Overview

Top  Previous  Next

 

An IOX plugin is a DLL that exports the following interfaces:

 

extern "C" __declspec(dllexport) int

IOXLoad(LOADPARMSIN *pParmsIn,

LOADPARMSOUT *pParmsOut);

 

extern "C" __declspec(dllexport) int

IOXUnload(UNLOADPARMSIN *pParmsIn,

UNLOADPARMSOUT *pParmsOut);

 

extern "C" __declspec(dllexport) int

IOXControl(CONTROLPARMSIN *pParmsIn,

CONTROLPARMSOUT *pParmsOut);

 

extern "C" __declspec(dllexport) int

IOXConfigure(CONFIGUREPARMSIN *pParmsIn,

CONFIGUREPARMSOUT *pParmsOut);

 

 

The input and output parameter structures along with some needed constants and types are declared in ioxPI.h.  The input structures always contain a length and version field which the main application sets to the total size of the structure and the version number of the structure.  If the size or version do not match those expected by the plugin, then the plugin has been compiled with a different version of the header file than the main application.  In this case, the plugin should probably fail the request by returning a non-zero error code.  The output structures also contain length and version fields that the plugin should set when returning information so that the main application can verify compatibility before accessing the return values.

 

Input plugins send events to the main application by calling a flat C event routine through a pointer supplied when the plugin is loaded.  The prototype for the plugin notification is:

 

typedef int (*PluginCallType)(EVENTPARMSIN *In, EVENTPARMSOUT *Out);

 

An input plugin sets the EVENTPARMSIN structure fields to values specifying the event  prior to making the event callback when generating an event.

 

 

Output plugins respond to an output request from the main application.  These requests take the form of calls to the plugins Control interface with type CONTROL_EXECUTE.