Thread-safety in VB+MFC Nested ActiveX controls
- From: ".Suchit" <Suchit@xxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Wed, 3 Aug 2005 23:25:42 -0700
Hi All,
Not sure about thread-safety issues & can following scenario work well:
Let's give some names:
(1) VB1 = Visual Basic 6.0 ActiveX control, non-windowless, threading model
Apartment
(2) Cls[..] = array of VB 6.0 Class module maintained inside above ActiveX
control (VB1)
(3) MFC1 = MFC 6.0 ActiveX control, non-windowless, threading model Apartment
Now from a multi-threaded client application, using GIT we are sending calls
to VB1. VB1 internally maintains one instance in Cls[..] array per thread.
This array element again creates one instance of MFC1 control and subscribes
to its events.
Now when MFC1 generates an event, the member of Cls[..] array calls a method
of VB1 parent control. Cls[..] members and VB1 are runtime-late-bound using
Object in VB. Static binding does not work. (this is anotehr strange problem)
Now when methods of VB1 are called by Cls[..] member elements, this VB1
generates events which are sink-ed by multi-threaded client.
This application works well for 10-15 minutes and suddenly generates an error:
Method '~' of object '~' failed.
Is this scenario Thread-Safe? What could be a potential source of problems?
Should I try maintaining a queue in VB1 for receiving event sinks (instead of
calling methids directly from Cls[...] objects)? Unfortunately in this forum
I don't know how to attach a diagram. I have a good diagram that explains the
visually nesting of our components.
Any help would be great.
.
- Follow-Ups:
- Re: Thread-safety in VB+MFC Nested ActiveX controls
- From: Alexander Nickolov
- Re: Thread-safety in VB+MFC Nested ActiveX controls
- Prev by Date: Re: Can GlobalInterfaceTable be CoCreateInstance()-ed by multiple thre
- Next by Date: Re: 2 mouses 2 pointers
- Previous by thread: Can GlobalInterfaceTable be CoCreateInstance()-ed by multiple thre
- Next by thread: Re: Thread-safety in VB+MFC Nested ActiveX controls
- Index(es):