Re: Delete dll
From: alpine (alpine_don'tsendspam_at_mvps.org)
Date: 09/06/04
- Next message: Volker Hilsheimer: "Re: How can I dump VB?"
- Previous message: Dave: "How can I dump VB?"
- In reply to: Dave: "Delete dll"
- Messages sorted by: [ date ] [ thread ]
Date: Mon, 06 Sep 2004 11:05:45 -0600
On Mon, 6 Sep 2004 07:43:27 +0100, "Dave" <dave5398@btinternet.com>
wrote:
>I have a C++ coded (non-COM) dll which I call from a VB exe.
>
>I want to unload the dll after use so I can delete the stored .dll file from
>the hard drive.
>
>How do I unload the dll, or release the file so it may be deleted?
>
>
>Dave
First off, why are you asking a non-COM question in COM and OLE
groups? ;-) For future reference, this type of question would be
better places in an API group.
You can explicitly load the library before calling anything in it
using the LoadLibrary API function and then call the FreeLibrary API
function to free the library when you are finished. This works
because VB will check to see whether or not the library is loaded
before making a call to it and if it isn't already loaded, it will
load it. You could also just call FreeLibrary enough times to unload
the library before attempting to delete it.
In any case, you will want to make sure that you either load a new
version of the library or that you app does not make any further calls
to the library because you will get an error if the library is no
longer present.
HTH,
Bryan
____________________________________________________________
New Vision Software "When the going gets weird,"
Bryan Stafford "the weird turn pro."
alpine_don'tsendspam@mvps.org Hunter S. Thompson -
Microsoft MVP-Visual Basic Fear and Loathing in LasVegas
- Next message: Volker Hilsheimer: "Re: How can I dump VB?"
- Previous message: Dave: "How can I dump VB?"
- In reply to: Dave: "Delete dll"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|