I know this isn't the correct forum, but I didn't find the right one :) I have a small problem regarding threading in C# and VB6 components. I have a software that contains several GATES, these gates can be stoped/started. When a gate is started it has an activator
thread, this thread just sits here and wait for some event so it knows that it's time to start another thread that creates an instance of a VB6 component and runs that component. This VB6 component is collecting data from one databas, converts it and the writes
it to another. The code in the VB6 components are really bad, some are really stupied, but I can't rewrite them (too many, and to little time). The VB6 com. uses RDO2.0 or ADO2.5 to connect to the database. Okey. I have serveral gates that I start, and they
runs fine, and I can, start/stop them. Then I start this special gate, it runs fine, but if I try to stop another gate now, it hangs and get att status: ready to stop. It has this status until I stop this special gate, then the other gates stops fine. So this
gate hangs the others, but I can't figure out why. My guess is that there is some strange thing going around with the databasconnection, but I can't figure it out. Is there a way to see how many connections are used, and what proccess is using that connection.
When I try to stop one of the other gates, and the hangs, I can see that the Terminate sub in the VB6 component has been run, but the thread in the gate is still Alive, then I try to Abort the thread and wait a few seconds (30) but it's still alive. So if
somebody knows how to kill a thread that can't be killed with Abort I would be glad. Thanks - Magnus
Gladh [BRF]
Member
80 Points
16 Posts
Thread problem..
Oct 21, 2003 01:39 PM|LINK