Exemplo n.º 1
0
        private static void GetTaxPrepAppUsingGuid()
        {
            var     helper            = new ComRegistrationHelper();
            var     guidTemplate      = ConfigurationManager.AppSettings["TaxPrepComGuidTemplate"];
            var     taxPrepFileName   = ConfigurationManager.AppSettings["TaxPrepFileName"];
            var     guid              = helper.CreateApplicationSpecificGuidFromTemplate(guidTemplate, taxPrepFileName);
            var     type              = Type.GetTypeFromCLSID(guid, true);
            dynamic comAccessProvider = Activator.CreateInstance(type);

            dynamic appInstance = comAccessProvider.GetAppInstance();

            _appInstance = (IAppInstance)appInstance;
        }
Exemplo n.º 2
0
 public override void InitializeTaxPrepAddin()
 {
     try
     {
         TaxPrepAppHelper.AppInstance = _appInstance;
         var helper = new ComRegistrationHelper();
         ComIds.CLSID_ComAccessProvider =
             helper.CreateApplicationSpecificGuidFromTemplate(ComIds.CLSID_ComAccessProviderTemplate,
                                                              Process.GetCurrentProcess().MainModule.FileName);
         OutOfProcComServer.Instance.RegisterComClasses();
     }
     catch (Exception e)
     {
         Log.Fatal(e, "Failed to load Taxprep COM Add-in.");
         throw;
     }
 }