Hi to all,
where have i to look at into my ATL COM project files
to check if i had checked the Free Threaded Marshaler option
when i created the component ?

Well i tried to look into the stdafx.h but i was only able
to see the apartment model set but nothing about FTM option

Tnx a lot
NikDH
Posted on 2002-03-08 05:41:40 by NikDH

Hi to all,
where have i to look at into my ATL COM project files
to check if i had checked the Free Threaded Marshaler option
when i created the component ?


Hi to all,
sorry 4 double posting but i found what i was looking 4 into the
FinalConstruct()
Its called the CoCreateFreeThreadedMarshaler() and that means the ftm is created :)

And i've understood why my component was crashing when firing events from the secondary thread
Its all due to the fact under VB is implemented the STA to access instances of the components and in my case i've 2 thread (the one that creates the instance of the component and the one created by the component itself) accessing the same component
When i try to fire events from the secondary thread i'm going to call some function into the the vb sink via the pointer it gives me
That pointer is valid only into the apartment it has been generated it means the secondary thread (the one thats not in the apartment) shouldnt use it
So i should put my secondary thread into another apartment (such as a MTA where it can access the component) and
and i've to do marshaling of the pointer to vb sink into the
the new apartment this way i can generate events even there
Is it right ?

Well i've read that another solution should be sending msgs to the 1st thread (the one in the right STA) from the secondary thread and in the 1st thread i've to handle them with:
BEGIN_MESSAGE_MAP
ON_MESSAGE(...)
END_MESSAGE_MAP

But i'm writing a dll activex and my class doesnt seem to have an handle itself so how should i send msgs there ?
Anyway if i try to implement msg map in my component i get lotsa compiling error that should be due to the fact this kinda component shouldnt have a msg map
Does it mean i cant use the windows method to communicate with my secondary thread ?

Tnx a lot
NikDH
Posted on 2002-03-08 07:03:40 by NikDH