unload DLL
-
my problem: I have to port a Project from C++ to C# there is a DLL, i can load
[DllImport("blabla.dll")] public extern static void CancelSearch(); . . .
and use it... and then end the programm BUT there is a deadlock, cause theFreeLibrary();
is never called by C# :( (if I remove the FreeLibrary(); in C++ then the C++ App hangs too) any idea how to unload the DLL? -
my problem: I have to port a Project from C++ to C# there is a DLL, i can load
[DllImport("blabla.dll")] public extern static void CancelSearch(); . . .
and use it... and then end the programm BUT there is a deadlock, cause theFreeLibrary();
is never called by C# :( (if I remove the FreeLibrary(); in C++ then the C++ App hangs too) any idea how to unload the DLL?At the command line prompt change to the directory the .dll is registered in and then type the following:
regsvr32 -u blabla.dll
You should get a prompt saying it has been unregistered. HTH Nick Parker
-
At the command line prompt change to the directory the .dll is registered in and then type the following:
regsvr32 -u blabla.dll
You should get a prompt saying it has been unregistered. HTH Nick Parker
-
my problem: I have to port a Project from C++ to C# there is a DLL, i can load
[DllImport("blabla.dll")] public extern static void CancelSearch(); . . .
and use it... and then end the programm BUT there is a deadlock, cause theFreeLibrary();
is never called by C# :( (if I remove the FreeLibrary(); in C++ then the C++ App hangs too) any idea how to unload the DLL?trying use app domains - put the dll calling code in a sep domain - then when you unload the domain the dll should get unload as well...
"When the only tool you have is a hammer, a sore thumb you will have."
-
my problem: I have to port a Project from C++ to C# there is a DLL, i can load
[DllImport("blabla.dll")] public extern static void CancelSearch(); . . .
and use it... and then end the programm BUT there is a deadlock, cause theFreeLibrary();
is never called by C# :( (if I remove the FreeLibrary(); in C++ then the C++ App hangs too) any idea how to unload the DLL?As far as i know the dll never gets loaded, u can only call static methods and the dll gets used to perform the function by Interop Services. Any dll (assembly) that gets loaded will be written to the debug console when they are loaded. MYrc : A .NET IRC client with C# Plugin Capabilities. See http://sourceforge.net/projects/myrc for more info. :-D
-
no, the DLL is not registered.. its just a normal DLL ... it waits till I call the
FreeLibrary();
function .... but I have no idea how to do this in C#So are you only trying to call the
FreeLibrary();
function from this .dll? If so and it is non .NET then you will need to use COM Interop. HTH Nick Parker
-
trying use app domains - put the dll calling code in a sep domain - then when you unload the domain the dll should get unload as well...
"When the only tool you have is a hammer, a sore thumb you will have."
-
thanks! I think this may work.... but I can't find any sample code with AppDomains do you know a link?:-O
-
So are you only trying to call the
FreeLibrary();
function from this .dll? If so and it is non .NET then you will need to use COM Interop. HTH Nick Parker
Normal DLL's dont use COM, and thus COM-interop will not be useful here.
-
Normal DLL's dont use COM, and thus COM-interop will not be useful here.
Christopher Lord wrote: Normal DLL's dont use COM, and thus COM-interop will not be useful here. Isn't it :((. I must have been spacing off when I was typing my response, please forgive. Nick Parker