|
-
ActiveX DLL unload delay
Hi Dan,
In the MSDN article, "Starting and Ending a Component"
(http://msdn.microsoft.com/library/de.../vbconstarting
endingcomponent.htm), there is the following note:
"A client application written in Visual Basic may not attempt to unload an
in-process component immediately after the last reference is released. The
frequency of attempts depends on how frequently idle time becomes available;
in general it will be around two minutes."
I am currently experiencing this exact thing where I have a component that
*apparently* releases all object references, etc and the ActiveX DLL will
unload after 2-3 minutes... Do you know of a way to *gracefully force*
(what an oxymoron!) this DLL to unload.. Would FreeLibrary work (and
would it unload dependent DLL's as well?)
Tim
--
Tim Tow, CPA MCSD
Microsoft MVP - Excel
Applied OLAP, Inc
-
Re: ActiveX DLL unload delay
Tim:
Now that's actually an interesting question.
My first reaction was to think no: FreeLibrary wouldn't work because when VB did
it's FreeLibrary
call you would get an error.
However... it occurred to me that the error might not cause a problem. Under
newer operating systems,
FreeLibrary doesn't cause an exception - just returns an error value. And VB
might not raise a runtime
error in that case.
So my suggestion is to try it. Use GetModuleHandle to get the handle and call
FreeLibrary on it.
Be absolutely sure all references have truly been released - or you will get
that exception. If it does work (and be
sure to test it on all the major OS's), let me know.
Dan
"Tim Tow, CPA MCSD" wrote:
> Hi Dan,
>
> In the MSDN article, "Starting and Ending a Component"
> (http://msdn.microsoft.com/library/de.../vbconstarting
> endingcomponent.htm), there is the following note:
>
> "A client application written in Visual Basic may not attempt to unload an
> in-process component immediately after the last reference is released. The
> frequency of attempts depends on how frequently idle time becomes available;
> in general it will be around two minutes."
>
> I am currently experiencing this exact thing where I have a component that
> *apparently* releases all object references, etc and the ActiveX DLL will
> unload after 2-3 minutes... Do you know of a way to *gracefully force*
> (what an oxymoron!) this DLL to unload.. Would FreeLibrary work (and
> would it unload dependent DLL's as well?)
>
> Tim
>
> --
> Tim Tow, CPA MCSD
> Microsoft MVP - Excel
> Applied OLAP, Inc
-
Re: ActiveX DLL unload delay
"Dan Appleman" <dan@desaware.com> wrote in message
news:38F2D1E2.F9272BF9@desaware.com...
> My first reaction was to think no: FreeLibrary wouldn't work because when
VB did
> it's FreeLibrary call you would get an error.
That is what I thought too.. And we were correct... It crapped in both
Win98 and Win2000.. I may try and use Numega SmartCheck to spy on the vb
runtime and see if/what it does to unload..
Any other takers? Chris Kinsman, Keith Pleas, are you out there?
--
Tim Tow, CPA MCSD
Microsoft MVP - Excel
Applied OLAP, Inc
Similar Threads
-
By Ilse in forum VB Classic
Replies: 2
Last Post: 04-20-2002, 07:03 AM
-
Replies: 0
Last Post: 04-02-2002, 02:52 PM
-
By Bruce Casson in forum VB Classic
Replies: 1
Last Post: 03-21-2002, 11:51 AM
-
By Ed in forum VB Classic
Replies: 7
Last Post: 05-11-2001, 08:21 PM
-
By Sam Wood in forum Enterprise
Replies: 0
Last Post: 05-17-2000, 01:48 AM
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
Forum Rules
|
Top DevX Stories
Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL
|
Bookmarks