Have you considered using the Microsoft.mshtml assembly instead? It provides all of the DOM functionality of the WebBrowser control without any of the threading issues (at least, none that I'm aware of...) Look in the Platform SDK for the MSHTML reference.
-Andy Hopper ----- Original Message ----- From: "James Crowley" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Wednesday, November 27, 2002 3:48 PM Subject: [ADVANCED-DOTNET] STAThread, COM interop and ASP.net > Hi, > > My component uses the WebBrowser control (via COM interop) to grab > certain bits of data from a web page. This works fine in a standard app, > but when I call it from an ASP.net page, you are told that we're not > using an STA thread, and the ActiveX control requires it. > > If I was writing an application with a Main() entry point, I'd just > stick in an [STAThread] attribute; but what do I do for my component? If > I add aspcompat=true to the ASP.net page, [which, I believe, puts > asp.net in STA mode] this sometimes works, sometimes hangs.... And I > really don't want customers to be having to stick in that tag for a > supposed .net component! > > Any suggestions? > > Thanks, > > ~ James Crowley You can read messages from the Advanced DOTNET archive, unsubscribe from Advanced DOTNET, or subscribe to other DevelopMentor lists at http://discuss.develop.com.