Sarah
2011-03-28 01:47:10 UTC
First, I'm quite new to multithread programming.
I have an old DLL written in Delphi that works great on a single
thread, but when called in VB.NET from a Parallel.For loop I get an
error "Attempted to read or write protected memory. This is often an
indication that other memory is corrupt."
There are 4 parameters. 2 pChar strings passed in, and 2 pChar
strings returned with the results. stdCall is used. There are no
global variables, and 1 Threadvar.
I compiled the same code in Free Pascal. It behaves the same way.
Works fine with 1 thread, same error when called in the Parallel.For.
Any guesses?
tia
I have an old DLL written in Delphi that works great on a single
thread, but when called in VB.NET from a Parallel.For loop I get an
error "Attempted to read or write protected memory. This is often an
indication that other memory is corrupt."
There are 4 parameters. 2 pChar strings passed in, and 2 pChar
strings returned with the results. stdCall is used. There are no
global variables, and 1 Threadvar.
I compiled the same code in Free Pascal. It behaves the same way.
Works fine with 1 thread, same error when called in the Parallel.For.
Any guesses?
tia