DllUnregisterDesigner API

Removes registry entries previously added with DllRegisterDesigner.

STDAPI DllUnregisterDesigner(
   DESIGNERREGINFO  *pDri
);

Parameter

pDri

[in] Pointer to a DESIGNERREGINFO structure with the following members:

Member Contents
cb A ULONG value specifying the size of the structure. Must be sizeof(DESIGNERREGINFO).
pszProgID An LPCOLESTR value specifying the programmatic ID (PROGID) of the previously registered object.
clsid A CLSID value specifying the class ID of the previously registered object.
guidTypeLib A GUID value specifying the type library ID of the previously registered object.
wVerMajor A WORD value specifying the major version number of the previously registered object.
wVerMinor A WORD value specifying the minor version number of the previously registered object.
rgbRegInfo An array of bytes previously returned by IDesignerRegistration::GetRegistrationInfo. Contains NULL if the designer does not implement IDesignerRegistration.

Return Value

An HRESULT value indicating success or failure.

Comments

The designer implements DllUnregisterDesigner. Designers that implement this API must set DESIGNERFEATURE_REGISTRATION in the registry. Support for DllUnregisterDesigner is optional, but must be provided if the designer supports DllRegisterDesigner.

The host automatically unregisters default information for a designer, including its ProgId, CLSID, and Typelib ID keys. Before removing the default information, the host calls the designer's DllUnregisterDesigner API so the designer can remove any custom information it registered with DllRegisterDesigner.

Designers should unregister all additional information they previously registered. However, subkeys under the default CLSID, ProgID, and Typelib ID keys need not be unregistered. When the host removes these keys, any subkeys added by the designer will be deleted automatically.

DllUnregisterDesigner is similar to DllUnregisterServer, except that DllUnregisterDesigner removes registry information specific to a single authored object. The host calls DllUnregisterDesigner once for each object that the designer previously registered with DllRegisterDesigner.

The rgbRegInfo member of the pDri parameter contains information returned to the host by IDesignerRegistration::GetRegistrationInfo. A designer can use this data structure to pass an array of bytes from its design-time instance to its run-time instance. Designers that allow the user to make design-time choices that affect registration should implement IDesignerRegistration and use this parameter to pass the necessary information.

DllUnregisterDesigner must be implemented in the DLL that implements the designer's run-time object.

Example

The following example implements DllUnregisterDesigner for a designer that registers the authored class denoted by CATID_NewClass under Implemented Categories:

STDAPI DllUnregisterDesigner(DESIGNERREGINFO *pdri)
{
   HRESULT hr = S_OK;
   ICatRegister* pICatRegister = NULL;
   CATID rgcatid[1];
   
// Set up array for ICatRegister routines.   
rgcatid[0] = CATID_NewClass;
   
// Create an instance.   
hr = CoCreateInstance (CLSID_StdComponentCategoriesMgr, NULL,
     CLSCTX_SERVER, IID_ICatRegister, (void**) &pICatRegister);
RETURN_ON_FAILURE(hr);

// Unregister the implemented category we previously registered.   
hr = pICatRegister->UnRegisterClassImplCategories(pdri->clsid, 1, 
     rgcatid);
RETURN_ON_FAILURE(hr);

if(pICatRegister != NULL)
   pICatRegister->Release();

return hr;

}

See Also

DllRegisterDesigner, IDesignerRegistration, DESIGNERFEATURE_REGISTRATION