473,387 Members | 3,033 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Cannot Release C++ win32 dll loaded by vb.net

Hi,

I 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

Jun 15 '06 #1
2 1698
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.
Jun 15 '06 #2
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:
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.


Jun 19 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: roblenderman | last post by:
I start in debug mode and set a breakpoint on the page load event for the startup page. The browser opens and the page renders. The breakpoint turns to a "?" and says the breakpiont cannot be...
8
by: baustin75 | last post by:
Posted: Mon Oct 03, 2005 1:41 pm Post subject: cannot mail() in ie only when debugging in php designer 2005 -------------------------------------------------------------------------------- ...
10
by: babak | last post by:
Hi everybody I'm working with a project in embedded Visual Studio 4 and I have a general problem which I hope that somebody can help me with. My problem is the following: My project works fine in...
6
by: dbuchanan | last post by:
I have a Windows Forms application that accesses SQL Server 2k from a small local network. The application has been used for weeks on other systmes but a new install on a new machine retruns...
0
by: thjwong | last post by:
I'm using WinXP with Microsoft Visual C++ .NET 69462-006-3405781-18776, Microsoft Development Environment 2003 Version 7.1.3088, Microsoft .NET Framework 1.1 Version 1.1.4322 SP1 Most developers...
4
by: ThunderMusic | last post by:
Hi, I have a custom form that works fine when I debug it or run it in release mode but cannot be loaded in the designer... Actually, it can be loaded in the designer when no control is on it, but...
6
by: Andrew Rowley | last post by:
I am having trouble getting debug and release builds to work properly with project references using C++ .NET and Visual Studio 2003. I created a test solution, with a basic Windows form C++...
4
by: GHUM | last post by:
The compile works, BUT linking fails: 2.5\Release\psycopg\_psycopg.def -Lc:\python25\libs -Lc: \python25\PCBuild -Lc:/p ostgres/83RC2/lib -lpython25 -lpq -lws2_32 -ladvapi32 -o build...
1
by: blondsecret | last post by:
Hello everyone, after installing a Strokes 'easylearning' CD-Rom, following dialogue is shown to me: Microsoft .NET Framework An unhandled exception has occurred in a component in your...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.