Board index » delphi » What apartment does a child-thread belong to?

What apartment does a child-thread belong to?

Each COM object declared with an STA threading model has one apartment
and one thread, right?
So if a COM object creates a child thread, what apartment does the child
thread belong to?
Does it belong to its parent's apartment, or does it automatically have
its own apartment,
or is it in some kind of twilight zone where it does not reside in any
apartment?
And what is the relationship between apartments and coInitializeEx() ?

  -   Sean B. Durkin

 

Re:What apartment does a child-thread belong to?


Each thread's apartment is determined at the point when the thread calls
CoInitialize/Ex. So your child thread's apartment is undefined until it
calls CoInitialize/Ex. Then and only then do you know which apartment it
wants to belong.

have fun
--
Binh Ly
http://www.techvanguards.com

Sean B. Durkin <sdur...@siliconrose.com.au> wrote in message
news:393B0917.86E8DE26@siliconrose.com.au...

Quote
> Each COM object declared with an STA threading model has one apartment
> and one thread, right?
> So if a COM object creates a child thread, what apartment does the child
> thread belong to?
> Does it belong to its parent's apartment, or does it automatically have
> its own apartment,
> or is it in some kind of twilight zone where it does not reside in any
> apartment?

> And what is the relationship between apartments and coInitializeEx() ?

>   -   Sean B. Durkin

Other Threads