Solved

Activex dll stuck in memory

Posted on 2001-08-03
19
358 Views
Last Modified: 2012-06-27
I am using an activex dll in my asp pages.  The problem is that everytime I need to modify the activex dll i get the error "permission denied" because something is holding onto the dll.  I need to restart the computer each time to free it up.

I have tried closing the browser and stopping Personal Web Server, nothing works.  I can't do anything to that dll until I reboot the machine.

Is there a way to unload this from memory, either manually or through the code?  I have already tried setting the object to nothing in the asp page and that does not work.

Thank you.
0
Comment
Question by:suzuki
  • 6
  • 3
  • 2
  • +6
19 Comments
 
LVL 20

Accepted Solution

by:
jitganguly earned 100 total points
Comment Utility
How are you stopping PWS ?

Go to Control panel, services, choose worlwideweb publishing services and stop and try.

Also close all browser windows and VID (if you use)
0
 
LVL 7

Expert Comment

by:John844
Comment Utility
you will have to close interdev also.  it holds a reference to the dll if you have opened the page referencing the component.
0
 
LVL 7

Expert Comment

by:John844
Comment Utility
sorry jitganguly, I new see you included that in your comment.
John
0
 
LVL 20

Expert Comment

by:jitganguly
Comment Utility
Hey John,
Good to see you on the list. Great job
0
 
LVL 5

Expert Comment

by:dredge
Comment Utility
suzuki:

if you are running NT workstation, or Win2K Pro, then i suggest setting up your .dll file in Microsoft Transaction Server. This will let you replace the file without having to stop or start anything.

it takes a minute or two to set up, but it's well worth the effort and will save you time and headaches in the end.
0
 
LVL 7

Expert Comment

by:John844
Comment Utility
Thanks jitganguly.

dredge has a good point, and it is also available with PWS.

you will find this in the nt option pack(even for PWS).
0
 
LVL 20

Expert Comment

by:jitganguly
Comment Utility
Well, I think his/her problem is to generate the DLL from the VB/VC++ source and MTS will not help in this matter. He/she needs to stop the service. At least for NT opt pack 4 I know I used to have trouble.
MTS will only allow him/her to make a better application
0
 
LVL 5

Expert Comment

by:dredge
Comment Utility
jit: (honest question - i'm sure you know but i want to ask, in order to let others know)

when you ran MTS with your .dll, did you manually register the dll? (regsvr32 myfile.dll) if you did, then this is where the problem is.

when setting up a dll in MTS, you should not register the dll manually - let MTS do it for you. when you do this, you will be able to replace the file with a newer version without having to stop and start any services. this is one of the biggest reasons i use mts.

but then, i don't have much experience with it on NT 4 - just Win2K.
0
 
LVL 20

Expert Comment

by:jitganguly
Comment Utility
Well, dredge  let me tell you my experience

I used to write Active X DLL from VB 5/6 and I used to  make DLL from VB itself and then move the DLL to web server, register it there with regsvr32 and put the DLL in MTS.
Now whenever I had to modify that DLL, I had this problem . In the sense after changing and moving it to the web server when I tried to re-register, I had to stop IIS, MTS everything ...
But I am talking about NT 4/option pack4 service pack 4
Don't know about win2k
0
Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

 

Author Comment

by:suzuki
Comment Utility
Thanks everyone for all your help but nothing works yet.  Maybe the problem is that I am doing this on a Win98 machine?


0
 
LVL 20

Expert Comment

by:jitganguly
Comment Utility
suzuki,
Just try closing web site adminstrations from control panel/services and try to recompile the dll
0
 
LVL 33

Expert Comment

by:hongjun
Comment Utility
Close all asp files in InterDev.
Stop PWS
Close all browsers.
Unregister your dll
Re-register your dll
Restart your computer

hongjun
0
 
LVL 33

Expert Comment

by:hongjun
Comment Utility
Sorry did not read your question carefully that you actually do not want to reboot your machine.

hongjun
0
 
LVL 14

Expert Comment

by:puranik_p
Comment Utility
On IIS, you just have to stop IIS to free and unregister dll.
but my friend, in case of PWS there is no other solution than restarting the system itself.
the only solution i can think of is..
Use IIS and NT if possible.
0
 
LVL 22

Expert Comment

by:CJ_S
Comment Utility
I am surprised that nobody has shown the exact syntax to stop the real PWS service.

For IIS you can type the following in the Run-dialog to stop IIS and unload the activex dll.
net stop iisadmin
and starts again using:
net start w3svc -e

For PWS you should type:
net stop w3svc
net start w3svc

Now your dll should also be freed.

Regards,
CJ
0
 
LVL 22

Expert Comment

by:CJ_S
Comment Utility
Another way you can debug your activex control / component is by running it in the IDE. For example if you are creating an activex dll, and you want to debug it. Set the project's properties correctly (run in browser, and point to the correct url where the dll is being used). Start the dll, and it will go to the url you have specified. As you can see the dll will be used which is running in the IDE. WHen you stop the component in the IDE, you can debug it further, and start again. This way you don't have to worry about stopping and starting the WWW service.

Regards,
CJ
0
 
LVL 5

Expert Comment

by:Droby10
Comment Utility
one thing that hasn't been addressed is the possiblity of two-way binding outside of the dll to other libraries and services (bad idea anyway, but it happens)...

stopping iis/pws/mts etc. will only release the object instances it's created from the iis/pws context...but if any of those objects are shared with external libraries, those objects would continue to exist and continue to lock the dll.

if this is what is going on the best programming practice is to create and release at a function/method scope; not on an object or application scope.  this means avoiding setting persistent objects within the session or application contents as well.
0
 
LVL 20

Expert Comment

by:jitganguly
Comment Utility
CJ_S,
Stopping IIS from Control panel/services is same as issuing net stop ...
Therefore I did not mention that
0
 
LVL 1

Expert Comment

by:Moondancer
Comment Utility
I am sorry to see that Asker has not returned to update and finalize this question.  I am, therefore, force accepting this question.  In the event the Asker returns with additional needs related to this question, please respond and continue the collaboration process.
 
If there are questions in this regard, please comment and I'll return when I can.
 
The HELP DESK link on the left is informative, and includes this site's Guidelines and Member Agreement as well as assistance related to Questions and Answers.  Here is the QA link, as a reference.
 
http://www.experts-exchange.com/jsp/cmtyQuestAnswer.jsp
 
Thank you,
Moondancer
Community Support Moderator @ Experts Exchange
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Suggested Solutions

I have helped a lot of people on EE with their coding sources and have enjoyed near about every minute of it. Sometimes it can get a little tedious but it is always a challenge and the one thing that I always say is:  The Exchange of information …
This demonstration started out as a follow up to some recently posted questions on the subject of logging in: http://www.experts-exchange.com/Programming/Languages/Scripting/JavaScript/Q_28634665.html and http://www.experts-exchange.com/Programming/…
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

763 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

7 Experts available now in Live!

Get 1:1 Help Now