Hi to all,
well i've another problem with my COM project

Well i've created a dll activex that exports an object with methods and events with the apartment threading model
That component has to create an extra thread every time
its instanced

When i use that component in a standard exe it works well
well i can call methods and retrive events correctly

When i use it in an exe activex with the "thread per object" option set and i create some instances of that object i can call methods correctly but when events occurs the component in the dll activex crashes
From the debug it seems that crashes when i do:
ptr->Fire_OnConnected(); /* Firing event*/

The ptr is the pointer to the class in the dll activex
Well i've to generate events this way coz i'm in a separate thread (the extra thread i told u before) and that pointer is saved in the local memory of the thread at its creation

The error that occurs seems to be an access fault coz it tries to read in some wrong address in memory

The fact that the component is working well in a standard exe and it only gives problem in an exe activex when trying to communicate form separate threads makes me think that the problem should be related to the threading model used ?
Is it wrong to use the single thread apartment model in the component developing in the dll activex ?

Tnx a lot
Posted on 2002-03-07 12:24:39 by NikDH