COM: a call from another thread causes failures, how to make it work in one thread?

I am doing a BHO (extension for IE) that accepts events in another thread. When I access the DOM from this other thread, IE crashes. Is it possible to make the DOM accessible from the same stream as the main BHO stream so that it does not crash?

Sounds like a general COM multithreading issue that I understand very little about.

+3
source share
4 answers

Look at using CoMarshalInterface or CoMarshalInterThreadInterfaceInStream

This will give you a wrapped interface to an STA COM object that is thread safe.

+3
source

IE, , - COM- , COM , , . , , , DOM COM-, STA, . , ... COM, IE.

+1

ah, COM.

, . , GIT ( ) , ... , cookie DWORD, GIT, , . ( GIT , )

0

. .

, BHOs, STA, :: SetSite() , ( BHO GlobalInterfaceTable @JasonS.

-, , , , MTA, , concurrency . , , COM- BHO, COM.

For example, if you want to track the incoming / outgoing data of a website that is looking for things (dangerous or sensitive), then you DO NOT want all these threads to pop out the throat of the STA object, because using Yahoo, for example, triggers more than 30 requests, and your BHO will start blocking IE.

0
source

Source: https://habr.com/ru/post/1698238/


All Articles