Click here to Skip to main content
Click here to Skip to main content
Articles » Languages » C# » COM Interop » Downloads
 
Add your own
alternative version
Go to top

Create ActiveX in .NET Step by Step

, 4 Mar 2008
Article describes how to create ActiveX in .NET and how to use it on an HTML page step by step.
AcriveXSourceCode.zip
AcriveXSourceCode
bin
Debug
ActiveXReport.dll
ActiveXTest.dll
Kosmala.Michal.ActiveXReport.snk
setup.zip
OurActiveX.ini
web.zip
Web
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" > 

<html>
  <head>
    <title>WebForm1</title>
    <meta name="GENERATOR" Content="Microsoft Visual Studio .NET 7.1">
    <meta name="CODE_LANGUAGE" Content="C#">
    <meta name=vs_defaultClientScript content="JavaScript">
    <meta name=vs_targetSchema content="http://schemas.microsoft.com/intellisense/ie5">
  </head>
  <body onload="OpenActiveX()">

  <!-- Our activeX object -->
  <OBJECT id="OurActiveX" name=�OurActiveX" classid="clsid:121C3E0E-DC6E-45dc-952B-A6617F0FAA32" VIEWASTEXT codebase="OurActiveX.cab"></OBJECT>	

  <!-- Attaching to an ActiveX event-->
<script language="javascript">
           function OurActiveX::OnClose(redirectionUrl)
	   {
		alert(redirectionUrl);   <!-- http://otherwebsite.com should be returned-->
                    //window.location = redirectionUrl;
           }
</script>


<script language="javascript">
	//Passing parameters to ActiveX object and starting application
function OpenActiveX()
{
	try
	{
		document.OurActiveX.MyParam = "Hi I am here." //Passing parameter to the ActiveX
		document.OurActiveX.Open(); //Running method from activeX
	}
	catch(Err)
	{
		alert(Err.description);
	}
}	


</script>

  </body>
</html>

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)

Share

About the Author

Michał Kosmala
Web Developer
Poland Poland
ASP.NET Developer since 2004

| Advertise | Privacy | Mobile
Web01 | 2.8.140916.1 | Last Updated 4 Mar 2008
Article Copyright 2008 by Michał Kosmala
Everything else Copyright © CodeProject, 1999-2014
Terms of Service
Layout: fixed | fluid