var dome;dome = new ActiveXObject("ASCOM.NexDome.Dome");dome.Connected = true;while (dome.ShutterStatus == 4); // Error - wait for shutter to go onlinedome.CloseShutter();dome.Connected = false;dome.Dispose();dome = null;