예제 #1
0
        public ProgIdRegistration(string progId, CLSID clsId)
        {
            _progId = progId;
            string rootKeyName   = RegistrationUtil.ClassesRootKey.Name;
            string progIdKeyName = rootKeyName + @"\" + _progId;
            string value         = clsId.ToString("B").ToUpperInvariant();

            // Register the ProgId for CLSIDFromProgID.
            Logger.ComAddIn.Verbose("ProgIdRegistration - Set Value - {0} -> {1}", progIdKeyName, value);
            RegistrationUtil.SetValue(progIdKeyName + @"\CLSID", null, value, RegistryValueKind.String);
        }
예제 #2
0
        public ClsIdRegistration(CLSID clsId, string progId)
        {
            _clsId       = clsId;
            _clsIdString = clsId.ToString("B").ToUpperInvariant();
            string clsIdRootKeyName = RegistrationUtil.ClsIdRootKey.Name;
            string clsIdKeyName     = clsIdRootKeyName + "\\" + _clsIdString;

            // Register the CLSID

            // NOTE: Remember that all the CLSID keys are redirected under WOW64.
            Logger.ComAddIn.Verbose("ClsIdRegistration - Set Values - {0} ({1}) - {2}", clsIdKeyName, progId, DnaLibrary.XllPath);
            RegistrationUtil.SetValue(clsIdKeyName + @"\InProcServer32", null, DnaLibrary.XllPath, RegistryValueKind.String);
            RegistrationUtil.SetValue(clsIdKeyName + @"\InProcServer32", "ThreadingModel", "Both", RegistryValueKind.String);
            if (!string.IsNullOrEmpty(progId))
            {
                RegistrationUtil.SetValue(clsIdKeyName + @"\ProgID", null, progId, RegistryValueKind.String);
            }
        }