An entire object class can be deleted from the system by deregistering it from the Workplace Shell This is achieved using the WinDeregisterObjectClass() function, which is shown in Figure "Deregistering an Object Class".
The WinDeregisterObjectClass() function accepts a string containing the object class name. Once a successful call is made to the WinDeregisterObjectClass() function, the object class is deleted from the system and is no longer available to other objects or applications. However, the DLL that contains the code for the object class is not automatically deleted from the system; if the Templates folder is subsequently opened with this DLL still resident in a directory in the system's LIBPATH, a template for the class will still appear in the folder. In order to prevent this, the DLL must be explicitly deleted from the system.
During processing of the WinDeregisterObjectClass() call, the system invokes the object's _wpclsUnInitData method, to free any instance data or resources that were obtained when the object class was created. See Creating an Object (Class Data) for an example of this method.