Re: MultiThreading an ActiveX DLL call...
In article <ejFnSz9SFHA.39 80@TK2MSFTNGP12 .phx.gbl>,
willy.denoyette @telenet.be says...
[color=blue]
>Beware if you create the instance of the COM object in MyThreadProcess
>constructor, you are effectively creating an instance on the UI thread.
>Willy,[/color]
You were right....the instanciation of the ActiveX was done in the
constructor, so in the main UI !
I have moved the instanciation to the method, and now it's better.
Last question :
How do you release memory allocated like this :
array_struct = new AX_DLL.VBStruct[3000000];
Is
array_stuct = null;
enough with the marshalling ?
I have tried to call a GC.Collet() inside the thread before it
terminates, but GC.Collet() does not seem to run into the background
thread, does it ?
Regards,
Cybertof.
In article <ejFnSz9SFHA.39 80@TK2MSFTNGP12 .phx.gbl>,
willy.denoyette @telenet.be says...
[color=blue]
>Beware if you create the instance of the COM object in MyThreadProcess
>constructor, you are effectively creating an instance on the UI thread.
>Willy,[/color]
You were right....the instanciation of the ActiveX was done in the
constructor, so in the main UI !
I have moved the instanciation to the method, and now it's better.
Last question :
How do you release memory allocated like this :
array_struct = new AX_DLL.VBStruct[3000000];
Is
array_stuct = null;
enough with the marshalling ?
I have tried to call a GC.Collet() inside the thread before it
terminates, but GC.Collet() does not seem to run into the background
thread, does it ?
Regards,
Cybertof.
Comment