Click here to Skip to main content
Click here to Skip to main content
Articles » Languages » C# » General » Downloads
 
Add your own
alternative version

Issues faced while extending IE with Band Objects using .NET and Windows Forms

, 13 Aug 2007
Issues faced while extending IE with Band Objects using .NET and Windows Forms
mytoolbar.zip
MyToolbar
lib
Interop.SHDocVw.dll
log4net.dll
source
BandObjectLib
BandObjects.snk
BandObjects.snk
MyToolbar.suo
SearchBar
BandObjects.snk
images
Ask.png
Google.png
MSN.png
Thumbs.db
Yahoo.png
Properties
ToolbarInstaller
ToolbarInstaller.vdproj
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Configuration.Install;
using System.Runtime.InteropServices;

namespace SearchBar
{
    [RunInstaller(true)]
    public partial class InstallerClass : Installer
    {
        public InstallerClass()
        {
            InitializeComponent();
        }

        /// <summary>
        /// This is called when installer's custom action executes and
        /// registers the toolbar which is extending a bandobject, as COM server.
        /// </summary>
        /// <param name="stateSaver"></param>
        public override void Install(System.Collections.IDictionary stateSaver)
        {
            base.Install(stateSaver);
            RegistrationServices regsrv = new RegistrationServices();
            if (!regsrv.RegisterAssembly(this.GetType().Assembly,
            AssemblyRegistrationFlags.SetCodeBase))
            {
                throw new InstallException("Failed To Register for COM");
            }
        }

        public override void Uninstall(System.Collections.IDictionary savedState)
        {
            base.Uninstall(savedState);
            RegistrationServices regsrv = new RegistrationServices();
            if (!regsrv.UnregisterAssembly(this.GetType().Assembly))
            {
                throw new InstallException("Failed To Unregister for COM");
            }
        }

        private void InstallerClass_AfterInstall(object sender, InstallEventArgs e)
        {
            string explorerPath = @"C:\Program Files\Internet Explorer\iexplore.exe";
            if (System.IO.File.Exists(explorerPath) == true)
            {
                System.Diagnostics.Process.Start(explorerPath);
            }
        }
    }
}

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here

About the Author

Sonal.India
Technical Lead
India India
No Biography provided

| Advertise | Privacy | Mobile
Web02 | 2.8.140721.1 | Last Updated 14 Aug 2007
Article Copyright 2007 by Sonal.India
Everything else Copyright © CodeProject, 1999-2014
Terms of Service
Layout: fixed | fluid