-
Recently Browsing 0 members
- No registered users viewing this page.
-
Similar Content
-
Microsoft Forms will add Copilot support for drafting surveys, creating questions and more
By John Callaham,
- 0 replies
- 1 view
-
Microsoft Forms now has a new Practice mode for quizzes to assist students
By John Callaham,
- microsoft
- microsoft forms
- (and 2 more)
- 6 replies
- 5 views
-
Microsoft launches the new Forms Windows 11 app
By John Callaham,
- microsoft
- microsoft forms
- (and 3 more)
- 7 replies
- 3 views
-
Google teases Pixel 8, Pixel Watch 2, and Pixel Buds Pro in new event videos
By Omer Dursun,
- google pixel
- (and 6 more)
- 4 replies
- 3 views
-
- 4 replies
- 2 views
-
Question
+Red King Subscriber²
Point of application,
Render Provided html string and print it using Internet Explorer, quickly in the background.
Problem,
WebBrowser control requires to be run in an STA thread stopping this thread (after Disposing the Web Browser) causes an IE script error.
I have a class which starts a WebBrowser Control in an STA thread,
Then, I give pipe it Html to load,
Then after it finished rendering, I tell it to print to a specific virtual printer.
That all works.
So now, I need to dispose of it.
This is what I have right now
The problem is with both renderThread.Abort() and ExitThread() - I have to commit both out not to get an error.
Both of these fail due to the WebBrowser control.
I don't feel like providing a screenshot, so here is the text,
The error comes from IE itself,
So, after calling Dispose methods including the WebBrowsers dispose method.
I try to stop the thread. Which gives me this error.
If I did NOT provide any html to render I think (been a long time) there is no Script Error.
But then, it completely kills the point of the application!
Note I do suppress Script Errors - when I created the WebBrowser.
Also, does anyone know of a way to provide images to the WebBrowser control without going through saving them to disk?
Link to comment
Share on other sites
2 answers to this question
Recommended Posts