Hi, I'm having some problems with concurrency when using DLLImport, I have a Dll that provides some report I need to send over the web, so I have this:
[DllImport("Rep.dll", EntryPoint = "PrintRep", CallingConvention = CallingConvention.StdCall,
CharSet = CharSet.Ansi)]
private static extern string PrintRep(several params...);
And over the Dll side there's lots of variables and instances that then returns a path with the report.
The code I have now has a lock around the call of PrintRep, which works, but obviously makes pending requests wait, is there a way for this to work without a lock? Because if I take out the lock I get several "Attempt to write on protected memory" errors and the Dll eventually hangs.