LOAD - v14


load                            <file>

Function

Load or unload an external dynamic library (with the extension DLL) and enable access to user code through commands defined by the user.  Multiple libraries (DLLs) can be loaded simultaneously.

Parameters

file

the name of the DLL file (including the full pathname or just the name if it is placed in the WINDIR directory).
Re-loading a previously loaded library results in the unloading of the named library.

Examples

load   polyg213.dll

Notes

In the library there must be a routine called Cus_ct_load called by Eagle to load the user defined command table. All user defined commands defined in the custom DLL can then be used until another LOAD command is issued.

 

If the variable DLL_DEBUG is defined in the EAGLE.INI (or custom user INI) file then the LOAD command prints out the user custom commands table.

 

A  routine which is called when an unLOAD is performed, called cus_ct_unload, can be used to free memory and resources used in the DLL.

 

The following code sample represents a skeleton for this function and should be added to the same module where the Cus_ct_load is included:

 

/********************************************************

   FUNCTION: Cus_ct_load()

          PURPOSE:  to release the DLL’s resources (eg. Memory,

 handles, etc.).

*********************************************************/

 

INT APIENTRY Cus_ct_unload( int *errorFlag )

 

{

// Put the user code here

. . . . .

// End of user code

 

return 0;   // failure

return 1;   // success
}

 

Also the .DEF file must contain a reference to the function:

 

LIBRARY   skeleton

 

CODE     PRELOAD MOVEABLE DISCARDABLE

DATA     PRELOAD SINGLE

 

EXPORTS

Cus_ct_load

Cus_ct_unload

 

<user functions>

See also

 Eagle User Custom Library