4.4.6 Implementing and Exposing the Component

LuaCOM

next up previous contents Next: 4.4.7 Initialization and Termination Up: 4.4 Building a LuaCOM Previous: 4.4.5 Registering the Component   Contents

4.4.6 Implementing and Exposing the Component

There are two different situations, which one demands different actions:

Implementing the Application Object
Here we must use the LuaCOM method NewObject to create a COM object and bind it to the table of the Lua Application Object. Them this object must be made available to other applications through ExposeObject.

Implementing other objects
The other objects of the component are obtained via the Lua Application Object as return values of functions or as values stored in the fields of the Lua Application Object (that is, via property access). These object should be implemented using ImplInterface. They can be implemented in the initialization (and then be stored somewhere) or can be implemented on-demand (that is, each time a COM object should be return, a call to ImplInterface is made).

Notice that the fields of the Lua table used to implement COM component will only be accessible if they are present in the type library. If not, they are invisible to COM.


next up previous contents
Next: 4.4.7 Initialization and Termination Up: 4.4 Building a LuaCOM Previous: 4.4.5 Registering the Component   Contents
Fabio Mascarenhas de Queiroz 2005-01-07