Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsVB SyntaxEnterprise DevelopmentDatabase AccessControlsCOMWin APICrystal ReportDeploymentGeneralGeneral 2
Related Topics
VB.NET / ASP.NETMS SQL ServerMS AccessOther Database ProductsMore Topics ...

VB Forum / COM / December 2004



Tip: Looking for answers? Try searching our database.

Unloading a DLL

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
ian - 23 Dec 2004 17:19 GMT
Hi All

I have a DLL written in VB6.
It is used for Debugging from another Language.
This other language is very limited in what it can do

All the DLL really does is display a form with a multi-line text box in the
initialize event and then the programmers can pass strings into a Method that
then displays the information in the multi-line text box line by line as it
comes in.

The problem is that when the programmers close the Debug Window the DLL is
not unloaded. And there is unfortunately no way to unload it from this Third
Party language.

Is there a way in the Debug Window form unload even to unload the DLL as
well and remove it from memory?

Signature

Thanks Heaps

Ian

Adrian Enders - 23 Dec 2004 17:39 GMT
I don't think so. Bad memory management in your host application. A DLL
cannot unload itself from memory, if I understand your problem correctly. I
think you can write another (external) program to scan for an instance of
this DLL in memory, and then kill it. I'm not sure how you would do that,
probably an API call. I can look into it if you pay me! ;) - j/k

HTH

Adrian

> Hi All
>
[quoted text clipped - 13 lines]
> Is there a way in the Debug Window form unload even to unload the DLL as
> well and remove it from memory?
ian - 23 Dec 2004 17:45 GMT
Hi

How about an ActiveX EXE.

Can that kill itself?

Ian

> I don't think so. Bad memory management in your host application. A DLL
> cannot unload itself from memory, if I understand your problem correctly. I
[quoted text clipped - 27 lines]
> > Is there a way in the Debug Window form unload even to unload the DLL as
> > well and remove it from memory?
Adrian Enders - 23 Dec 2004 18:05 GMT
Not that I know of, not in this way. Because the objects are created from
your "Third Party Language", it has to kill the thread. As you said, "And
there is unfortunately no way to unload it from this Third Party language."
I have had a couple problems with this with some third party applications
that we use as well. The only method of destroying the object was through
Task Manager. unfortunately I am not much help with this, other than to say
that I don't think this is possible. For your sake, I hope I am wrong. If I
were attempting to create a program that did this, I would look into API
calls. Try this ...

http://www.mentalis.org/agnet/apiguide.shtml

> Hi
>
[quoted text clipped - 35 lines]
> > > Is there a way in the Debug Window form unload even to unload the DLL as
> > > well and remove it from memory?
Ken Halter - 23 Dec 2004 17:50 GMT
If they're calling methods from a debugging utility, you should be able to
add one that unloads that form and sets it to nothing (which is probably why
the dll's not dying anyway)

Signature

Ken Halter - MS-MVP-VB - http://www.vbsight.com
Please keep all discussions in the groups..

> Hi All
>
[quoted text clipped - 17 lines]
> Is there a way in the Debug Window form unload even to unload the DLL as
> well and remove it from memory?
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.