RAD Studio VCL Reference
ContentsIndex
PreviousUpNext
ComServ.DllCanUnloadNow Function

Tells Windows whether it can unload the in-process server exporting this function.

Pascal
function DllCanUnloadNow: HResult; stdcall;
C++
__stdcall HRESULT DllCanUnloadNow();

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.  
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.
 

Copyright(C) 2009 Embarcadero Technologies, Inc. All Rights Reserved.
What do you think about this topic? Send feedback!