AfxOleUnregisterTypeLib

BOOL AFXAPI AfxOleUnregisterTypeLib( REFGUID tlID );

Return Value

Nonzero if the type library was successfully unregistered; otherwise 0.

Parameters

tlID

The unique ID of the type library.

Remarks

Call this function to remove the type library entry from the Windows registration database.

Example

// Type library GUID, corresponds to the uuid attribute of the library
// section in the .odl file.
const GUID CDECL BASED_CODE _tlid =   { 0x9dbafcd2, 0x592f, 0x101b,
 { 0x85, 0xce, 0x0, 0x60, 0x8c, 0xec, 0x29, 0x7b } };

// Type library major version number, number on the left of decimal
// point, in version attribute of the library section in .odl file.
const WORD _wVerMajor = 1;

// Type library minor version number, number on the right of decimal
// point, in version attribute of the library section in .odl file.
const WORD _wVerMinor = 0;

STDAPI DllUnregisterServer(void)
{
   AFX_MANAGE_STATE(AfxGetStaticModuleState());

   // register typelib with locale neutral
   if (!AfxOleUnregisterTypeLib(_tlid, _wVerMajor, _wVerMinor, LOCALE_NEUTRAL))
      return ResultFromScode(SELFREG_E_TYPELIB);

   // register classes
   if (!COleObjectFactoryEx::UpdateRegistryAll(FALSE))
      return ResultFromScode(SELFREG_E_CLASS);

   return S_OK;
}

See Also   AfxOleUnregisterClass, AfxOleRegisterTypeLib