Creating .NET Components accessibly by classic ASP
-
I was wondering if anyone has some good resources on how to create a .NET component that is accessible by using VBScript and Classic ASP. I know this is possible according to some of the things I've read, but I can't seem to find and actual implementation guides. Any help is appreciated! Thanks!
-
I was wondering if anyone has some good resources on how to create a .NET component that is accessible by using VBScript and Classic ASP. I know this is possible according to some of the things I've read, but I can't seem to find and actual implementation guides. Any help is appreciated! Thanks!
You can create COM components in .NET, which is the only way I can imagine this working. Christian I have several lifelong friends that are New Yorkers but I have always gravitated toward the weirdo's. - Richard Stringer
-
I was wondering if anyone has some good resources on how to create a .NET component that is accessible by using VBScript and Classic ASP. I know this is possible according to some of the things I've read, but I can't seem to find and actual implementation guides. Any help is appreciated! Thanks!
On top of what Cristian said, the machine will have to have the .NET Framework installed just to use your component. You might want to start reading up on Exposing .NET Framework Components to COM[^]. RageInTheMachine9532 "...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
-
On top of what Cristian said, the machine will have to have the .NET Framework installed just to use your component. You might want to start reading up on Exposing .NET Framework Components to COM[^]. RageInTheMachine9532 "...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
Thank's for the information. The problem I am having is exposing it to VBScript. Whenever I use the following command I get a non-descript error:
Set PageRender = Server.CreateObject("MC.PageRenderer")
Here is my code. I'm trying to keep it simple until I understand how to implement it.
<Guid("3BFA03FD-B85D-48de-A9E8-FAE266B2D809"), _
InterfaceType(ComInterfaceType.InterfaceIsIDispatch)> _
Public Interface _PageRender
<DispId(1)> Function ChooseContent(ByVal CalWidth As Integer, ByVal CalHeight As Integer) As String
<DispId(2)> Function GetNews(ByVal Width As Integer, ByVal Heading As String, ByVal IsImage As Boolean) As String
<DispId(3)> Property Action() As String
<DispId(4)> Property SubCommand() As String
<DispId(5)> Property ID() As Integer
End Interface<Guid("385AA220-84CD-4e25-A736-E3356C33F4A8"), _
ClassInterface(ClassInterfaceType.None), _
ProgId("MinistryCraft.PageRenderer")> _
Public Class PageRenderer
Implements _PageRenderPublic Property Action() As String Implements \_PageRender.Action Get End Get Set(ByVal Value As String) End Set End Property Public Function ChooseContent(ByVal CalWidth As Integer, ByVal CalHeight As Integer) As String Implements \_PageRender.ChooseContent Return CalWidth & "W x " & CalHeight & "H" End Function Public Function GetNews(ByVal Width As Integer, ByVal Heading As String, ByVal IsImage As Boolean) As String Implements \_PageRender.GetNews End Function Public Property ID() As Integer Implements \_PageRender.ID Get End Get Set(ByVal Value As Integer) End Set End Property Public Property SubCommand() As String Implements \_PageRender.SubCommand Get End Get Set(ByVal Value As String) End Set End Property End Class
Do I need to register this assembly with the global cache?
-
Thank's for the information. The problem I am having is exposing it to VBScript. Whenever I use the following command I get a non-descript error:
Set PageRender = Server.CreateObject("MC.PageRenderer")
Here is my code. I'm trying to keep it simple until I understand how to implement it.
<Guid("3BFA03FD-B85D-48de-A9E8-FAE266B2D809"), _
InterfaceType(ComInterfaceType.InterfaceIsIDispatch)> _
Public Interface _PageRender
<DispId(1)> Function ChooseContent(ByVal CalWidth As Integer, ByVal CalHeight As Integer) As String
<DispId(2)> Function GetNews(ByVal Width As Integer, ByVal Heading As String, ByVal IsImage As Boolean) As String
<DispId(3)> Property Action() As String
<DispId(4)> Property SubCommand() As String
<DispId(5)> Property ID() As Integer
End Interface<Guid("385AA220-84CD-4e25-A736-E3356C33F4A8"), _
ClassInterface(ClassInterfaceType.None), _
ProgId("MinistryCraft.PageRenderer")> _
Public Class PageRenderer
Implements _PageRenderPublic Property Action() As String Implements \_PageRender.Action Get End Get Set(ByVal Value As String) End Set End Property Public Function ChooseContent(ByVal CalWidth As Integer, ByVal CalHeight As Integer) As String Implements \_PageRender.ChooseContent Return CalWidth & "W x " & CalHeight & "H" End Function Public Function GetNews(ByVal Width As Integer, ByVal Heading As String, ByVal IsImage As Boolean) As String Implements \_PageRender.GetNews End Function Public Property ID() As Integer Implements \_PageRender.ID Get End Get Set(ByVal Value As Integer) End Set End Property Public Property SubCommand() As String Implements \_PageRender.SubCommand Get End Get Set(ByVal Value As String) End Set End Property End Class
Do I need to register this assembly with the global cache?
If you going to share this thing with a bunch of different evnironments and applications, then yes, I'd put in the GAC. Also, you'll have to use RegAsm to register the assembly for COM use. RageInTheMachine9532 "...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
-
Thank's for the information. The problem I am having is exposing it to VBScript. Whenever I use the following command I get a non-descript error:
Set PageRender = Server.CreateObject("MC.PageRenderer")
Here is my code. I'm trying to keep it simple until I understand how to implement it.
<Guid("3BFA03FD-B85D-48de-A9E8-FAE266B2D809"), _
InterfaceType(ComInterfaceType.InterfaceIsIDispatch)> _
Public Interface _PageRender
<DispId(1)> Function ChooseContent(ByVal CalWidth As Integer, ByVal CalHeight As Integer) As String
<DispId(2)> Function GetNews(ByVal Width As Integer, ByVal Heading As String, ByVal IsImage As Boolean) As String
<DispId(3)> Property Action() As String
<DispId(4)> Property SubCommand() As String
<DispId(5)> Property ID() As Integer
End Interface<Guid("385AA220-84CD-4e25-A736-E3356C33F4A8"), _
ClassInterface(ClassInterfaceType.None), _
ProgId("MinistryCraft.PageRenderer")> _
Public Class PageRenderer
Implements _PageRenderPublic Property Action() As String Implements \_PageRender.Action Get End Get Set(ByVal Value As String) End Set End Property Public Function ChooseContent(ByVal CalWidth As Integer, ByVal CalHeight As Integer) As String Implements \_PageRender.ChooseContent Return CalWidth & "W x " & CalHeight & "H" End Function Public Function GetNews(ByVal Width As Integer, ByVal Heading As String, ByVal IsImage As Boolean) As String Implements \_PageRender.GetNews End Function Public Property ID() As Integer Implements \_PageRender.ID Get End Get Set(ByVal Value As Integer) End Set End Property Public Property SubCommand() As String Implements \_PageRender.SubCommand Get End Get Set(ByVal Value As String) End Set End Property End Class
Do I need to register this assembly with the global cache?
If you are getting the "Can't create Activex Component" error is because you either: a. did not register the component for COM use b. did not copy the component to the same directory where the calling program is located. All the information you need is found in the resources already mentioned by other people.