Develop ActiveX elements -> Interface -> zenOnExit
Prototype: boolean zenOnExit();
This method is called by the zenon Runtime when the ActiveX control is closed. Here all dispatch pointers on variables should be released.