There are two different situations, which one demands different actions:
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
.
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.