Click here to Skip to main content
15,894,170 members
Articles / Programming Languages / C#

Downloading C# ActiveX Components through CAB File

Rate me:
Please Sign up or sign in to vote.
4.57/5 (18 votes)
24 Jul 2007CPOL3 min read 278.9K   2.3K   58  
This article describes the procedure to create an ActiveX Component in C#, download it from server and execute it on client side in Web based application.
using System;
using System.Text;
using System.Windows.Forms;
using System.Collections.Generic;
using System.Runtime.InteropServices;

namespace DownloadedApp
{
    [Guid("D1E40FCE-E964-4dfd-B07E-BDE49D3519A1")]
    interface IDownload
    {
        void InvokeMethod();
    }
    /// <summary>
    /// COM exposed .Net class.
    /// </summary>
    [ClassInterface(ClassInterfaceType.AutoDual)]
    [Guid("A47C22B1-3CC3-45bc-801E-3FCC4FFD3E45")]
    public class Download : IDownload
    {
        /// <summary>
        /// COM exposed Method.
        /// </summary>
        public void InvokeMethod()
        {
            MessageBox.Show("ClientSide Component invoked sucessfully!!", "ClientSide Component", MessageBoxButtons.OK, MessageBoxIcon.Information);
        }
    }
}

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, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Software Developer (Senior)
India India
IUnknown.

Comments and Discussions