SilverScreen Solid Modeler

rex_load

rex_load

Previous topic Next topic  

rex_load

Previous topic Next topic JavaScript is required for the print function  

SilverScreenAPI

 

int rex_load( char *rex_name )

 

char *rex_name;      // name of DLL to load

 

 

 




Synopsis

#include "silver.h"

 

rex_load loads a DLL into the SilverScreen address space, and makes it available for communicating with a SilverC program.

 

 

Parameters

rex_name is the address of a character string that names the DLL to be loaded. The filename may or may not include the final ".dll" extension, one will be appended if it is missing (this allows the same code to be used to load both REX and DLL files, for example handle = rex_load( "HELPER" )). The name passed is not further modified, and the Win32 API function LoadLibrary is then used to load the DLL. This implies that the normal Windows conventions are used to locate the DLL: current directory, Windows directory, Windows system directory, etc.

 

 

Return Value

The return value of rex_load is a handle to the DLL which may be used to identify the DLL to subsequent REX calls if rex_load succeeds.. it will be 0 otherwise.

 

 

Comments

A particular DLL may be loaded multiple times via rex_load; any loads after the first one do not cause the DLL to be really loaded, but a reference count is maintained. When a DLL is loaded for the first time, a call to rex_exec with an op argument of REX_FIRST_LOAD is generated. Additionally, a call to rex_exec with an op argument of REX_LOADING is generated for every call to rex_load; the reference count is incremented. Conversely, a call to rex_exec with an op argument of REX_UNLOADING is generated for every call to rex_unload, and the reference count is decremented. When the reference count for a particular DLL reaches 0, then a call to rex_exec with an op argument of REX_REMOVED is generated, and the DLL is removed from memory.

 

 

See Also

rex_exec, rex_unload