Krool, I don't have the deep understanding of multi-threading that you do. Is there reason why you need to RaiseEvent vs. an Implementation? The idea I was suggesting is something like this. It is rough, not polished:
The caller would use: Implements IThreadCode:' new Interface to be used by customers. Let's say it's named: IThread Public Sub AsyncProcedure(ByVal SyncCallback As IThreadSyncCallback): End Sub Public Sub SyncCallback(ByRef Argument As Variant): End Sub ' the Thread.Cls add this: Private m_Consumer As IThread change Create to: Public Function Create(Owner As IThread) As Boolean Set m_Consumer = Owner ' validate that Nothing was not passed ' then instead of raising the two events, this: m_Consumer.SyncCallback Argument and m_Consumer.AsyncProcedure SyncCallback add this in the Terminate event: Set m_Consumer = Nothing
and then initiate with: BackgroundWorker.Create Me
Edited: Many of the changes you make may break binary compatibility, unless you create new function names, i.e., CreateEx instead of modifying the Create function signature.




Reply With Quote