Wrox Home  
Search P2P Archive for: Go

  Return to Index  

pro_vb thread: Destroying objects


Message #1 by "Desmond" <desmond_otoole@h...> on Tue, 27 Mar 2001 17:32:29
Your problem is a well-known "feature" of IIS/PWS.  IIS/PWS grabs your dll
and does not let it go.  You do not need to re-boot your machine.  Run this
command from the command line to stop IIS/PWS (put it in a *.bat file,
because you will be executing it a lot):

net stop iisadmin /y

This will release your DLL.  Run these next commands to re-start IIS/PWS:

net start w3svc
net start smtpsvc

While debugging, you can avoid this hassle by always running your DLL's VB
project in the VB IDE when executing the ASP page that calls the DLL.  Then
IIS/PWS grabs the VB project that is running in the IDE, instead of the DLL
on the machine.

Another way to avoid the problem is to use ActiveX EXEs instead of DLLs,
since EXEs run in their own memory space.  Also, with EXEs you can use
DCOMCNFG to assign the component it's own user name and password, an
important security feature if you are hitting a database.

Good luck.  Calling DLLs from ASP pages can be a real pain-in-the-ass,
despite the exhortations we get from Microsoft.  In many cases, especially
with DLLs that need to be recompiled fairly frequently, I found the hassle
is just not worth the slight performance gain.

Tom Regan
senior application developer

pmh caramanning inc.
34705 W. 12 Mile Rd.
Farmington Hills, MI 48331-3261
xxx-xxx-xxxx
fax:  xxx-xxx-xxxx
email: tregan@p... <mailto:tregan@p...> 
www.pmh.com

--------------------------------------------------
Subject: Destroying objects
From: "Desmond" <desmond_otoole@h...>
Date: Tue, 27 Mar 2001 19:24:10
X-Message-Number: 4

Regarding my last mail. "Destroying Objects"
I am not using IIS i have PWS on my NT4.0 workstationWith
Visual studio 6 . I have done a response write after setting
the object to Null and this was confirmedI closed down the Browser 
Internet Developer and VB6. (Nothing left to close). Re opened VB6
and and tried to write the DLL again. I seems tha the browser has
realeased the object but the DLL doesn't know. I have to Re-boot the PC
each time.


  Return to Index