EDN Admin
Well-known member
Yo .NET dudes:
Seeking expert guidance on how to go about C# COM registries as I got my C# COM wrapper to be called from Classic ASP for a legacy system. The trouble is each time I modify the class or function in the C# COM wrapper, it doesnt reflect in the registries.
Heres what I followed for C# COM as I am new to COM: http://msdn.microsoft.com/en-us/library/c3fd4a20.aspx
Should I write a C# exe to clear although the following batch script I got for clearing doesnt always hit the nail on its head.
Although my C# COM has got a lot of classes and functions here’ s an example Code Snippet of how I go about coding the C# COM wrapper
// C# Code (ClassicASPCOM.dll) built with Strong Name and Registered for COM Interop in Visual Studio 2005 (.NET Framework 2.0) and Windows 7:
using System;
using System.Runtime.InteropServices;
namespace ClassicASPCOM
{
[ComVisibleAttribute(true)]
[Guid("4042FE79-8ACA-4E5D-9F14-2FF7C6AE8D88")]
public interface IGetMessage
{
[DispId(1)]
string GetMessage(string Message);
}
[ComVisibleAttribute(true)]
[Guid("9A133858-5893-4CA7-9048-345CD0FCF535"),
ClassInterface(ClassInterfaceType.None)]
public class ClassCOM : IGetMessage
{
public string GetMessage(string Message)
{
return "Your Message: " + Message;
}
}
}
// COM Installation Batch Script:
Regasm ClassicASPCOM.dll
Regasm ClassicASPCOM.dll /codebase
Regasm ClassicASPCOM.dll /tlb
gacutil/i ClassicASPCOM.dll
// COM Uninstallation Batch Script:
iisreset
Regasm/u ClassicASPCOM.dll
gacutil/u ClassicASPCOM.dll
// VBScript (ClassicASPHome.asp):
<%
response.write("My first ASP script!")
Dim com
Set com = Server.CreateObject("ClassicASPCOM.ClassCOM")
response.Write(ccom.GetMessage("1234567890"))
response.Write("Alls well that ends well.")
%>
Please help me with a C# program to clear the registries or to automate.
Thanks
View the full article
Seeking expert guidance on how to go about C# COM registries as I got my C# COM wrapper to be called from Classic ASP for a legacy system. The trouble is each time I modify the class or function in the C# COM wrapper, it doesnt reflect in the registries.
Heres what I followed for C# COM as I am new to COM: http://msdn.microsoft.com/en-us/library/c3fd4a20.aspx
Should I write a C# exe to clear although the following batch script I got for clearing doesnt always hit the nail on its head.
Although my C# COM has got a lot of classes and functions here’ s an example Code Snippet of how I go about coding the C# COM wrapper
// C# Code (ClassicASPCOM.dll) built with Strong Name and Registered for COM Interop in Visual Studio 2005 (.NET Framework 2.0) and Windows 7:
using System;
using System.Runtime.InteropServices;
namespace ClassicASPCOM
{
[ComVisibleAttribute(true)]
[Guid("4042FE79-8ACA-4E5D-9F14-2FF7C6AE8D88")]
public interface IGetMessage
{
[DispId(1)]
string GetMessage(string Message);
}
[ComVisibleAttribute(true)]
[Guid("9A133858-5893-4CA7-9048-345CD0FCF535"),
ClassInterface(ClassInterfaceType.None)]
public class ClassCOM : IGetMessage
{
public string GetMessage(string Message)
{
return "Your Message: " + Message;
}
}
}
// COM Installation Batch Script:
Regasm ClassicASPCOM.dll
Regasm ClassicASPCOM.dll /codebase
Regasm ClassicASPCOM.dll /tlb
gacutil/i ClassicASPCOM.dll
// COM Uninstallation Batch Script:
iisreset
Regasm/u ClassicASPCOM.dll
gacutil/u ClassicASPCOM.dll
// VBScript (ClassicASPHome.asp):
<%
response.write("My first ASP script!")
Dim com
Set com = Server.CreateObject("ClassicASPCOM.ClassCOM")
response.Write(ccom.GetMessage("1234567890"))
response.Write("Alls well that ends well.")
%>
Please help me with a C# program to clear the registries or to automate.
Thanks
View the full article