-
Notifications
You must be signed in to change notification settings - Fork 8
Closed
Description
What steps will reproduce the problem?
1. submit let browser = new System.Forms.WebBrowser();; to fsi
2. expand "browser" root node in fseye
What is the expected output? What do you see instead?
Expect normal behavior, but instead get prompted with an unhandled exception
dialog:
System.Threading.ThreadStateException: Current thread must be set to single
thread apartment (STA) mode before OLE calls can be made. Ensure that your Main
function has STAThreadAttribute marked on it.
at System.Windows.Forms.WebBrowserBase.OnHandleCreated(EventArgs e)
at System.Windows.Forms.Control.WmCreate(Message& m)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.WebBrowserBase.WndProc(Message& m)
at System.Windows.Forms.WebBrowser.WndProc(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
Please use labels and text to provide additional information.
Nodes are loaded asynchronously and in parallel using F#'s async feature. i.e.
nodes are being loaded on threads from a thread pool which cannot be set to
STAThreadAttribute
(http://social.msdn.microsoft.com/forums/en-US/Vsexpressvb/thread/a23a47f8-efd2-
4117-b107-6757254d8e27). However, we may be able to test whether specific
values are IOleObjects
(http://msdn.microsoft.com/en-us/library/windows/desktop/dd542709(v=vs.85).aspx)
and create special STAThreads for those rarer cases (continue using the thread
pool for most cases).
Original issue reported on code.google.com by stephen....@gmail.com on 9 Apr 2012 at 6:53