xxtbg / fseye

Automatically exported from code.google.com/p/fseye
Apache License 2.0
0 stars 0 forks source link

Bug: exception loading nodes for Ole object #20

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
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

GoogleCodeExporter commented 9 years ago
Workaround.

In the example given, submitting browser;; to fsi before attempting to expand 
the browser node in fseye will prevent this bug from manifesting.

Original comment by stephen....@gmail.com on 9 Apr 2012 at 6:56

GoogleCodeExporter commented 9 years ago
This issue was closed by revision r262.

Original comment by stephen....@gmail.com on 13 Apr 2012 at 6:02

GoogleCodeExporter commented 9 years ago

Original comment by stephen....@gmail.com on 13 Apr 2012 at 7:47