PDA

Click to See Complete Forum and Search --> : [RESOLVED] Third Party DLL Will Not Unlock


steve65
Feb 15th, 2006, 01:50 PM
Hi All,

I have a third party DLL I use to access their application. I create a object referencing their DLL use it clean up the object. But I still have the DLL locked even after the clean up. I have also place the function calling the DLL into another class, and then I called my class, which called the third party DLL and still I can't unlock the DLL. The last thing I did was to try and put my class that called the third party DLL as part of an AppDomain. I unloaded the domain and still the DLL was lock.

Can anyone give me a pointer on how to call a DLL but then have it not be locked after I am done using the functions in it.

Thanks Steve

techgnome
Feb 15th, 2006, 01:53 PM
What do you mean by "locked"?

-tg

steve65
Feb 15th, 2006, 07:50 PM
The DLL is loaded into memory. When my program loads the DLL it is initialized with certain values set by configuration files. As long as it is loaded in memory, I cannot get it to reinit.

If I exit completely out of my program the DLL is then removed from memory and then I can reset it using new values.

I am hoping to do one of two things have it be able to unload out of memory will leaving my program open. Alternatively, create a helper program that will run the functions of the DLL I need and then pass back the information I need to my main program.

jmcilhinney
Feb 15th, 2006, 07:56 PM
Is this DLL a .NET assembly or a COM library? Are you Disposing the objects that you create correctly, assuming that the author has provided the means?

steve65
Feb 15th, 2006, 08:14 PM
It is setup as an interop so I am assuming that it is a .net component. I am usingif (client != null) Marshal.ReleaseComObject(client);to unload the objects out of my program and I then set it to null.