RegisterTypeForComClients() private method

private RegisterTypeForComClients ( Type type, RegistrationClassContext classContext, RegistrationConnectionType flags ) : int
type System.Type
classContext RegistrationClassContext
flags RegistrationConnectionType
return int
コード例 #1
0
        static void Main(string[] args)
        {
            Debug.WriteLine("M:{0}/U:{1} - Main()", Thread.CurrentThread.ManagedThreadId, PInvoke.GetCurrentThreadId());

            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);

            //if (args.Length > 0)
            //    MessageBox.Show(args[0]);

            if (args.Length == 1 && args[0] == "-Embedding")
            {
                MessageBox.Show(args[0]);
                return;
            }

            RegistrationServices rs = new RegistrationServices();
            int cookie = rs.RegisterTypeForComClients(typeof(Class1), RegistrationClassContext.LocalServer, RegistrationConnectionType.MultipleUse);

            try
            {
                Application.Run(new Form1());
            }
            catch
            {
            }

            rs.UnregisterTypeForComClients(cookie);
        }
コード例 #2
0
        public static void Initialize()
        {
            regService = new RegistrationServices();

            cookie = regService.RegisterTypeForComClients(
                typeof(NotificationActivator),
                RegistrationClassContext.LocalServer,
                RegistrationConnectionType.MultipleUse);
        }
 internal static void RegisterCOMServer()
 {
     _services = new RegistrationServices();
     _cookie = _services.RegisterTypeForComClients(typeof(DeploymentServiceCom), RegistrationClassContext.LocalServer, RegistrationConnectionType.MultipleUse);
 }
コード例 #4
0
 /// <summary>
 /// register DtsProjectExtendedDeployPropertyPage for COM. Must be registered every time Vis Studio starts up
 /// </summary>
 private void RegisterClassesForCOM()
 {
     try
     {
         RegistrationServices regSvc = new RegistrationServices();
         object[] attributes = typeof(DtsProjectExtendedDeployPropertyPage).GetCustomAttributes(typeof(GuidAttribute), false);
         if (attributes.Length == 0)
             throw new Exception("Couldn't finding GuidAttribute on DtsProjectExtendedDeployPropertyPage");
         guidForCustomPropertyFrame = new Guid(((GuidAttribute)attributes[0]).Value);
         regSvc.RegisterTypeForComClients(typeof(DtsProjectExtendedDeployPropertyPage), ref guidForCustomPropertyFrame);
     }
     catch (Exception ex)
     {
         throw new Exception("Problem registering DtsProjectExtendedDeployPropertyPage for COM", ex);
     }
 }