We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
close icon

HtmlConverter

Is there a way to use the HtmlConverter and not get the following error without placing AspCompat ="true" at the top of the aspx page because this is not an option for my application.

ActiveX control '8856f961-340a-11d0-a96b-00c04fd705a2' cannot be instantiated because the current thread is not in a single-threaded apartment.


1 Reply

GM Geetha M Syncfusion Team October 13, 2011 07:10 AM UTC

Hi,

Thank you for evaluating Syncfusion products.

Our HTMLConverter makes use of WebBrowser control which can run only in STA mode. Please make use of the following code to avoid Active X error:

Thread t = new Thread(CreateDocument);
t.SetApartmentState(ApartmentState.STA);
t.Start();
t.Join();

Please try this and let me know if you have any questions.

Regards,
Geetha


Loader.
Live Chat Icon For mobile
Up arrow icon