next up previous contents
Next: 5. Release Information Up: 4. Implementing COM objects Previous: 4.5 Running the COM   Contents

4.6 Generating Events

The method NewObject returns a connection point container object. This object allows the component to send events to its clients just calling methods on this object, passing the expected parameters. Return values are not allowed yet. Example:
-- Initializes server
function StartAutomation()

  -- creates and exposes COM proxy application object
  COMAppObject, events = luacom.NewObject(implementation_table, "My.Application")
      
  cookie = luacom_ExposeObject(COMAppObject)
end

function application:ReDraw()

  -- redraws the window
  application:UpdateScreen()

  -- Notifies client using the connection point container object
  events:redraw()
end


Vinicius da Silva Almendra 2004-02-19