Saturday, 31 August 2013

Creating Windows setup

Creating Windows setup

I am creating a windows setup and which loads a flash to show devices
attached in system from which user can select default device.
But when showing form which loads flash swf it throws exception of
ThreadStateException, so i added [STAThread] and used SetApartmentState
method to set Single thread apartment. but it is not working still and
throwing InvalidOperationException in setApartment method.
System.Threading.ThreadStateException: ActiveX control
'd27cdb6e-ae6d-11cf-96b8-444553540000' cannot be instantiated because the
current thread is not in a single-threaded apartment.
at System.Windows.Forms.AxHost..ctor(String clsid, Int32 flags)
at AxShockwaveFlashObjects.AxShockwaveFlash..ctor()
at FlashVideoApplication.frmShowDevices.InitializeComponent()

No comments:

Post a Comment