How to unload a dll

M

Mike

I am calling a function in a third party dll from a VB.NET application
(see below), and would like to unload the dll after using it. How would
I do that, from the code?

Public Declare Function SomeFunction Lib "ThirdParty.dll" _
(ByRef i As Integer) As Boolean
..
..
..

Dim i As Integer
Dim b As Boolean = SomeFunction(i)

'Unload the dll now, without restarting the application?

Mike O'Connor
 
H

Herfried K. Wagner [MVP]

Mike said:
I am calling a function in a third party dll from a VB.NET application
(see below), and would like to unload the dll after using it. How would
I do that, from the code?

Public Declare Function SomeFunction Lib "ThirdParty.dll" _
(ByRef i As Integer) As Boolean

Untested: P/invoke with the 'FreeLibrary' function.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top