About COM Entry Points

You need to use __declspec(dllexport) to export the entry point.

When calling an entry point, XSI passes a context through which the entry point can get the information, services, and additional arguments it needs:

   HRESULT Update(UpdateContext *, OutputPort *);

Parameter

Description

UpdateContext *

Reference to the operator update context object.

OutputPort *

Output port to write to.

You can unload and reload an add-on library file while you are debugging it. The Init function manages loading and reloading of add-on library files:

   HRESULT Init(UpdateContext*, long )

Parameter type

Description

UpdateContext*

Reference to the operator update context object.

long

Specifies whether Init is called when the DLL is loaded for the first time (0) or when it is reloaded (XSI::siDLLLoadingUnloading).

You can unload and reload an add-on library file while you are debugging it. The Term function manages unloading and destruction of add-on library files:

   HRESULT Term(UpdateContext*, long )

Parameter

Description

UpdateContext*

Reference to the operator update context object.

long

Specifies whether Term is called when the operator object is being destroyed (0) or unloaded (XSI::siDLLLoadingUnloading).

 

An entry point should be declared with C linkage to prevent C++ compilers from mangling the function names.For more information, see Exporting Entry Points, Event And Command Handlers.

The functions that you write depend on what you want your plug-in to do. Most plug-ins need to get parameters and inputs, and set outputs in their Update entry points. XSI passes an UpdateContext and an OutputPort to the Update entry point. Parameters and inputs are obtained from the Operator which can be retrieved from the UpdateContext. The output value or object to modify is obtained from the OutputPort.

If the plug-in has more than one output, the Update entry point is called to update only one output at a time. The plug-in can find out which output is being updated from the OutputPort.