System.Win.ComServ.DllCanUnloadNow
Delphi
function DllCanUnloadNow: HResult;
Properties
Type | Visibility | Source | Unit | Parent |
---|---|---|---|---|
function | public | System.Win.ComServ.pas | System.Win.ComServ | System.Win.ComServ |
Description
Tells Windows whether it can unload the in-process server exporting this function.
Do not call DllCanUnloadNow directly. DllCanUnloadNow is exported by ActiveX servers (DLLs) and is called by the operating system to indicate whether the server can be unloaded from memory because it is no longer in use. A DLL is no longer in use when it is not managing any existing objects (the reference count on all of its objects is 0).
The return values for DllCanUnloadNow are as follows:
Value | Meaning |
---|---|
S_OK |
The DLL can be unloaded. |
S_FALSE |
The DLL cannot be unloaded now. |
Note: DllCanUnloadNow is one of four functions in the Comserv unit that every in-process ActiveX server must export so that Windows can manage the server resources properly. The others are DllGetClassObject, DllRegisterServer, and DllUnregisterServer.