<div dir="ltr">Hi,<div><br></div><div>I'm having issues adding an active event listener via the XPCOM api. I've created a class from the template in the documentation:</div><div><br></div><div><div>#pragma once</div><div><br></div><div>#include <VirtualBox_XPCOM.h><br></div><div><br></div><div>namespace VirtualBox</div><div>{</div><div><br></div><div>class CVirtualBoxEventListener : public IEventListener</div><div>{</div><div>public:</div><div><span style="white-space:pre">        </span>NS_DECL_ISUPPORTS<br></div><div>        NS_DECL_IEVENTLISTENER</div><div>};<br></div><div><br></div><div>}</div></div><div><br></div><div>and put the NS_IMPL_ISUPPORTS1(CVirtualBoxEventListener, IEventListener) macro in my cpp file. But the HandleEvent method is never called. I register the listener by getting the event source from the console object like this (sorry for all the macros, that I have for exception handling):</div><div><br></div><div><div>CComPtr<IEventSource> pEventSource;</div><div><span style="white-space:pre">     </span>CHECK_VIRTUALBOXAPI(m_pConsole->GetEventSource(getter_AddRefs(pEventSource)), "could not retrieve virtual machine event source object");</div><div><span style="white-space:pre"> </span>PRUint32 nMachineStateChangeEvent = VBoxEventType_OnMachineStateChanged;</div><div><span style="white-space:pre">      </span>CHECK_VIRTUALBOXAPI(pEventSource->RegisterListener(m_pMachineStateChangeEventListener, 1, &nMachineStateChangeEvent, true), "could not register virtual machine state change event listener");</div></div><div><br></div><div>No events are triggered but on shutdown the VBOX XPCOM runtime actually releases the object so it seems that it is aware of it. With active mode, is there anything else I should be calling? I looked up some python examples which do call a python VBOX API method waitForEvents. Is there something similar in the C++ XPCOM API?</div></div>