Welcome! Log In Create A New Profile

Advanced

Alexander Predl: [WD23] How can I unload a .NET object/assembly

Posted by harvey68 
Alexander Predl: [WD23] How can I unload a .NET object/assembly
September 08, 2018 06:36PM
Autor: Alexander Predl

Link zum Beitrag: [27130.foren.mysnip.de]

Hi,

I need a little help with a .NET assembly.

The .NET assembly works well for the first time. On the second call, I
cannot get a connection to the terminal. What do I wrong?

My code: (code very short, only to demostrate the problem)
tim_terminal is SIX.TimApi.Terminal dynamic
tim_terminal = new "SIX.TimApi.Terminal"
tim_terminal.Connect()

On exit:
tim_terminal.Disconnect()
delete tim_terminal

With Sysinternals "ListDlls" the TimApi.dll shows in memory, even after
I "delete" the instance?!

I tried:

nID=LoadDLL("TimApi.DLL")
and on exit:
FreeDLL(nID)

but without success, TimApi.dll is still in memory.

BTW: the complete code is in a window, so it "should" destroy after
closing the window??

GetActiveObject does not work for .NET assemblys (LoadDll/FreeDll too I
think?!)

How can I complete unload/delete the loaded .NET object??

(sorry for cross posting on Google+, but it's urgent)
Arie: [WD23] How can I unload a .NET object/assembly
September 08, 2018 06:37PM
Autor: Arie

Link zum Beitrag: [27130.foren.mysnip.de]

Alexander,

try putting your declaration global and not in the window
tim_terminal is SIX.TimApi.Terminal dynamic
tim_terminal = new "SIX.TimApi.Terminal"

And skip the 'delete'

Maybe not what we've learned in our OOP lessons but if it works, it
works...
GuenterP: [WD23] How can I unload a .NET object/assembly
September 08, 2018 06:38PM
Autor: GuenterP

Link zum Beitrag: [27130.foren.mysnip.de]

Hi Arie,

thank you, exactly did the trick!
Author:

Your Email:


Subject:


Spam prevention:
Please, enter the code that you see below in the input field. This is for blocking bots that try to post this form automatically. If the code is hard to read, then just try to guess it right. If you enter the wrong code, a new image is created and you get another chance to enter it right.
Message: