/// <summary>
        /// Unregisters a managed type that's exposed for COM interop as safe for initializing and scripting
        /// </summary>
        /// <param name="comType"></param>
        public static void UnregisterSafeForScripting(Type comType)
        {
            Guid clsid = comType.GUID;
            Guid interfaceSafeScripting       = new Guid(CATID_SafeForScripting);
            Guid interfaceSafeForInitializing = new Guid(CATID_SafeForInitializing);

            ICatRegister reg = (ICatRegister) new ComComponentCategoriesManager();

            reg.UnRegisterClassImplCategories(ref clsid, 1, new Guid[] { interfaceSafeScripting });
            reg.UnRegisterClassImplCategories(ref clsid, 1, new Guid[] { interfaceSafeForInitializing });
        }
示例#2
0
        /// <summary>
        /// Unregisters the classes in the specified category.
        /// </summary>
        public static void UnregisterClassInCategory(Guid clsid, Guid catid)
        {
            ICatRegister manager = (ICatRegister)CreateLocalServer(CLSID_StdComponentCategoriesMgr);

            try
            {
                manager.UnRegisterClassImplCategories(clsid, 1, new Guid[] { catid });
            }
            finally
            {
                ReleaseServer(manager);
            }
        }
示例#3
0
 public void UnRegisterCategories(Guid[] categoryIds)
 {
     _catRegister.UnRegisterClassImplCategories(ref _classId, (uint)categoryIds.Length, categoryIds);
 }