Error: .Net Multithreading against VB6 COM+

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top