Re: webbrowser in thread ?



Thanks! I will try.


"Igor Tandetnik" <itandetnik@xxxxxxxx>
news:%23ec8Y8WmIHA.1184@xxxxxxxxxxxxxxxxxxxxxxx
"Sam Shi" <shixy@xxxxxxxxx> wrote in message
news:erfRNTVmIHA.5368@xxxxxxxxxxxxxxxxxxxx
Can I create a webbrowser in a thread?

You probably mean, in a worker thread other than the main thread. Yes you
can, as long as this thread enters STA (see CoInitialize) and pumps window
messages (see GetMessage, DispatchMessage).
--
With best wishes,
Igor Tandetnik

With sufficient thrust, pigs fly just fine. However, this is not
necessarily a good idea. It is hard to be sure where they are going to
land, and it could be dangerous sitting under them as they fly
overhead. -- RFC 1925



.



Relevant Pages

  • Re: atl and threads
    ... within an interface method of an STA object. ... >> too - they can only call back on the same STA thread. ... >> In your case you don't need it for sure, because a worker thread ...
    (microsoft.public.vc.atl)
  • Re: Thread issue/leak?
    ... > The true thread is doing Interop, the simple example below is not (the ... > simple example produces the error/issue, with or without the STA ... >>>I am creating a worker thread from inside an aspx page and the thread ... >>> window I observe the new thread, but the previous thread is still there ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: GetInterfaceFromGlobal hangs worker thread
    ... the worker thread, because the layout object is already in the STA ... - Back from ILayout::Render to ASP script ...
    (microsoft.public.vc.atl)
  • Problem related to accessing STA server from MTA client
    ... I have a client component operating in an MTA. ... Now I try to access the STA ... component from this worker thread. ... from which the thread was created, or does a new apartment get created? ...
    (microsoft.public.vc.language)
  • Re: difference between STA and MTA
    ... > Any thread that calls CoInitialize() is said to enter the Single ... > Threaded Apartment. ... If someone calls an object that is created on a thread in an STA ... it in c# :-) i uses CoInitializeso my app will be STA right? ...
    (microsoft.public.dotnet.languages.csharp)