Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug: exception loading nodes for Ole object #20

Closed
GoogleCodeExporter opened this issue Jul 13, 2015 · 3 comments
Closed

Bug: exception loading nodes for Ole object #20

GoogleCodeExporter opened this issue Jul 13, 2015 · 3 comments

Comments

@GoogleCodeExporter
Copy link

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 [email protected] on 9 Apr 2012 at 6:53

@GoogleCodeExporter
Copy link
Author

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 [email protected] on 9 Apr 2012 at 6:56

@GoogleCodeExporter
Copy link
Author

This issue was closed by revision r262.

Original comment by [email protected] on 13 Apr 2012 at 6:02

  • Changed state: Fixed

@GoogleCodeExporter
Copy link
Author

Original comment by [email protected] on 13 Apr 2012 at 7:47

  • Added labels: Milestone-Release1.0.1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant