G
Guest
Hello,
Sorry for the repost in this group, but we are desdesperate.
We are trying to use .NET multithreading capabilities in our VB6 COM+ application.
Right now our scenario is this one:
We have a VB.Net exe which calls VB.Net (name: Multithread) assembly with multithreading capabilities.
The .Net multithreaded assembly(inherits from servicedComponent) that creates threads which interoperate with a VB6 COM+ dll which is registered as a COM+ application. The vb6 dll has one method which inserts a record in the database (VB6 uses getObjectContext).
Example of our multithreaded code:
Dim i As Integer
For i = 0 To totalThreads- 1
Dim objContainer As New Container
objContainer.InData = inserts(i)
arrThreads(i) = New System.Threading.Thread(AddressOf objContainer.Method)
arrThreads(i).Start()
Next
'Wait and Finish
For i = 0 To totalThreads- 1
arrThreads(i).Join()
Next
The objContainer.Method calls a TLBIMPED interoperable VB6 COM+ dll.
We are using the Thread.Join method to query the subprocess to see if they are all finished.
Our problem here is that the Join doesn´t work and we get this execption:
'System.Runtime.InteropServices.COMException' Excepción de HRESULT: 0x8004E005
I have googled and can´t seem to find anything.
I don´t know if this has to do with apartment model of VB6, or if i am misisng something or the apartment of the VB6 DLL.
Any help or "Ilumination" would be really appreciated.
Thanks,
Sam
Sorry for the repost in this group, but we are desdesperate.
We are trying to use .NET multithreading capabilities in our VB6 COM+ application.
Right now our scenario is this one:
We have a VB.Net exe which calls VB.Net (name: Multithread) assembly with multithreading capabilities.
The .Net multithreaded assembly(inherits from servicedComponent) that creates threads which interoperate with a VB6 COM+ dll which is registered as a COM+ application. The vb6 dll has one method which inserts a record in the database (VB6 uses getObjectContext).
Example of our multithreaded code:
Dim i As Integer
For i = 0 To totalThreads- 1
Dim objContainer As New Container
objContainer.InData = inserts(i)
arrThreads(i) = New System.Threading.Thread(AddressOf objContainer.Method)
arrThreads(i).Start()
Next
'Wait and Finish
For i = 0 To totalThreads- 1
arrThreads(i).Join()
Next
The objContainer.Method calls a TLBIMPED interoperable VB6 COM+ dll.
We are using the Thread.Join method to query the subprocess to see if they are all finished.
Our problem here is that the Join doesn´t work and we get this execption:
'System.Runtime.InteropServices.COMException' Excepción de HRESULT: 0x8004E005
I have googled and can´t seem to find anything.
I don´t know if this has to do with apartment model of VB6, or if i am misisng something or the apartment of the VB6 DLL.
Any help or "Ilumination" would be really appreciated.
Thanks,
Sam