next up previous contents
Next: 3.4.7 Initialization and Termination Up: 3.4 Building a LuaCOM Previous: 3.4.5 Registering the Component   Contents

3.4.6 Implementing and Exposing the Component

Here we're dealing with COM objects implemented in Lua. Typically the COM server will call a Lua function (like StartAutomation) to do this task. 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: 3.4.7 Initialization and Termination Up: 3.4 Building a LuaCOM Previous: 3.4.5 Registering the Component   Contents
Vinicius da Silva Almendra 2003-06-27