vb.net - Create Multiple Instances of ActiveX DLL COM object -
vb.net - Create Multiple Instances of ActiveX DLL COM object -
i have vb6 dll need phone call .net application. want execute function in 1 of the dll's classes on separate threads in .net - is, separate dll instance per thread. single-threading, works great. multiple threads, appears 1 instance of dll beingness used. should note function takes several adodb recordsets arguments , returns integer. recordsets updated when homecoming .net. have set 2 class arguments.
mydll.dll public class myclass public function myfunction(rs1 recordset, rs2 recordset) integer 'some work end function end class .net app public class netclass public sub doit() dim md new mydelegate(addressof workit) md.begininvode(rs1, rs2, nothing, nothing) end sub private delegate sub mydelegate(byval rs1 recordset, byval rs2 recordset) private sub workit(byval rs1 recordset, byval rs2 recordset) dim advertisement appdomain = appdomain.create([a variable]) dim obj object = ad.createcominstancefrom("c:\program files\mydll.dll", "mydll.myclass") end sub end class in workit() sub, sec line produces error "could not load file or assembly 'file:///c:\program files\mydll.dll' or 1 of dependencies. module expected contain assembly manifest.
can please point me in right direction?
thanks in advance!
this article looking for.
vb.net multithreading dll com appdomain
Comments
Post a Comment