For an overview how COM/ActiveX components can be used from Xbase++ refer to the Xbase++ help ActiveX Overview, expecially to the section Reacting to COM/ActiveX events. Here you can find a working sample how to react to the MS Word quit-event.