|
web
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Cannot Release C++ win32 dll loaded by vb.netI have a dll declared in my VB.Net Webservice as below Declare Function fntest Lib "test.dll" _ Alias "TEST_FUNC" (ByVal a As Integer, ByVal b As Integer, ByVal c As Single) As Double result = fntest (1,3,5) Return result After running this webservice, iam not able to delete the test.dll, it says access denied. I have to re-boot my machine to delete this test.dll. How can we get this dll loaded to be released in the VB.net code? Will the dll be loaded to memory each time we call the webservice? I would appreciate any help Thanks Saish >How can we get this dll loaded to be released in the VB.net code? You can try calling FreeLibrary. But why do you want to release it? Ifit's only for replacing it during development, you can kill the ASP.NET worker process. >Will the dll be loaded to memory each time we call the webservice? No, it's only loaded once per process.Mattias -- Mattias Sjögren [C# MVP] mattias @ mvps.org http://www.msjogren.net/dotnet/ | http://www.dotnetinterop.com Please reply only to the newsgroup. Hello Mattias
Thanks for your reply. I was reading about loading and releasing in VB using the below functions Public Declare Function GetProcAddress Lib "kernel32" (ByVal hModule As Long,... Public Declare Function LoadLibrary Lib "kernel32" Alias "LoadLibraryA" Public Declare Function FreeLibrary Lib "kernel32" (ByVal hLibModule As Long) ... But it also says in vb.net it does not matter if we use the above functions.., Also when you declare your dll functions as below Declare Function fntest Lib "test.dll" _ Alias "TEST_FUNC" (ByVal a As Integer, ByVal b As Integer, ByVal c As Single) As Double It loads your dll, so no need to use loadlibrary. Using the above "fntest" declaration I don't know how to get the FreeLibrary function called as I don't have a handle to the dll. Please can you help me how can this be coded. Thanks Saish Mattias Sjögren wrote: Show quoteHide quote > >How can we get this dll loaded to be released in the VB.net code? > > You can try calling FreeLibrary. But why do you want to release it? If > it's only for replacing it during development, you can kill the > ASP.NET worker process. > > > >Will the dll be loaded to memory each time we call the webservice? > > No, it's only loaded once per process. > > > > Mattias > > -- > Mattias Sjögren [C# MVP] mattias @ mvps.org > http://www.msjogren.net/dotnet/ | http://www.dotnetinterop.com > Please reply only to the newsgroup.
How to Send an SMS
URI IsFile Streaming a file to text? How to force upper case in a DataGridView column? Dealing with NULL values in Integer fields Mulples threads and impersonation What's the Best Startup Scenario for Unattended Server Execution? Handle pointers from delphi client to a vb.net dll VB.net 2005 splash screen Updating a DataSet while using DataGridView |
|||||||||||||||||||||||