Got this rather nasty-sounding error. The full message is
System.Threading.ThreadStateException: ActiveX Control '<someGUID>' cannot be instantiated because the current thread is not in a single-threaded apartment.
Thing is, I'm not using threads !
The error is ocurring in a form that has a webbrowser control (.net, not activex) embedded in it.
Aha! http://support.microsoft.com/kb/841295
Now, the million dollar question: Why an ActiveX ? I am using the .net browser control.
Aha! http://support.microsoft.com/kb/841295
Now, the million dollar question: Why an ActiveX ? I am using the .net browser control.
What's the control you're using?
-- peter
The one on the "Microsoft Controls" group in Visual designer
And what website did you navigate to? Maybe that's using an Active X Control?
Just guessing.
Nachricht geändert durch Mike Fechner
[edit] My bad - wrong class from MSDN. You're not using the WebBrowserSite class, just the WebBrowser. Please ignore this comment.
From MSDN, it looks like that control's a wrapper form an ActiveX (see the Remarks): http://msdn.microsoft.com/en-us/library/system.windows.forms.webbrowser.webbrowsersite.aspx
[edit] but I'm still interested in this ...
When do you see the error?
-- peter
Message was edited by: Peter Judge
pjudge wrote:
[edit] My bad - wrong class from MSDN. You're not using the WebBrowserSite class, just the WebBrowser. Please ignore this comment.
From MSDN, it looks like that control's a wrapper form an ActiveX (see the Remarks): http://msdn.microsoft.com/en-us/library/system.windows.forms.webbrowser.webbrowsersite.aspx
[edit] but I'm still interested in this ...
When do you see the error?
-- peter
Message was edited by: Peter Judge
The error pops up when it is about to show the page.
mikefe wrote:
And why website did you navigate to? Maybe that's using an Active X Control?
Just guessing.
I'll change the site and let you know
meh. Tried several - amazon.co.uk, redstore.com etc.
Thing is, I cannot dictate which sites the user can and can't go to
You could do using some parental control software.... But is this behaviour site dependent? Would you mind sharing one of the non working sites with us?
meh. Tried several - amazon.co.uk, redstore.com etc.
Thing is, I cannot dictate which sites the user can and can't go to
Are those bad sites or good?
I tried them both (and some other sites, like Microsoft's) and they all seemed to work OK, with the attached code.
I should also note my OS etc:
WinXP SP3, IE 6
[View:~/cfs-file.ashx/__key/communityserver-discussions-components-files/19/7024.assemblies.xml:550:0]
[View:~/cfs-file.ashx/__key/communityserver-discussions-components-files/19/form1.cls:550:0]
[View:~/cfs-file.ashx/__key/communityserver-discussions-components-files/19/form1.resx:550:0]
[View:~/cfs-file.ashx/__key/communityserver-discussions-components-files/19/start.p:550:0]
-- peter
XP ... IE6 .... signs of a person reluctant to modernize?
pjudge wrote:
Aha! http://support.microsoft.com/kb/841295
Now, the million dollar question: Why an ActiveX ? I am using the .net browser control.
What's the control you're using?
-- peter
Ah, may have tracked it down. Using the component "standalone" I could not break it at all. However, in the application I am using another component (ipworks xmpp). It seems as this may be the troublemaker. I got another error suggesting that the activex control (again, not using one _unless_ this component is a wrapper) is at fault:
"This is an ill-behaved multi-threaded control. It cannot be used with the Progress 4GL. (9179)" .
How can I tell if the component is multi-threaded or a wrapper ? Is there any way of telling if a component is ABL friendly ?
bad form to reply to oneself, but this may be of interest to everyone following this thread (ha! geddit ? huh ?)
jmls wrote:
bad form to reply to oneself, but this may be of interest to everyone following this thread (ha! geddit ? huh ?)
Interesting. Did you try the suggested workaround?
xmpp1:InvokeThrough = this-object.
-- peter
PS it's good to have a new set of bad puns available to us as ABL developers ...
Really spooky - I was literally typing a followup
Yes, it seems to have cured the problem. At least I am not getting any strange errors, and no hanging. One for the KB, methinks !
Thanks to all for the help and suggestions