G
Guest
I created a .NET library using the VS 2003 COM template. I can do a
CreatObject() from vbscript, but none of the properties are visible. What is
wrong?
Here is the code:
<ComClass(ComClass1.ClassId, ComClass1.InterfaceId, ComClass1.EventsId)> _
Public Class ComClass1
#Region "COM GUIDs"
' These GUIDs provide the COM identity for this class
' and its COM interfaces. If you change them, existing
' clients will no longer be able to access the class.
Public Const ClassId As String = "570CB39C-0685-468A-ABDE-0E3AD0A9A666"
Public Const InterfaceId As String =
"4A60BD8A-41FF-407E-BDF5-1962BA23E70A"
Public Const EventsId As String = "B1D20E70-59D6-4D1C-B566-7F227F0119D1"
#End Region
' A creatable COM class must have a Public Sub New()
' with no parameters, otherwise, the class will not be
' registered in the COM registry and cannot be created
' via CreateObject.
Public Sub New()
MyBase.New()
End Sub
Private csError As String ' stores the error message
Public ReadOnly Property ErrorMsg() As String
Get
Return csError
End Get
End Property
Public Function Concat(ByVal str1 As String, ByVal str2 As String) As
String
Return Concat = str1 & " " & str2
End Function
End Class
CreatObject() from vbscript, but none of the properties are visible. What is
wrong?
Here is the code:
<ComClass(ComClass1.ClassId, ComClass1.InterfaceId, ComClass1.EventsId)> _
Public Class ComClass1
#Region "COM GUIDs"
' These GUIDs provide the COM identity for this class
' and its COM interfaces. If you change them, existing
' clients will no longer be able to access the class.
Public Const ClassId As String = "570CB39C-0685-468A-ABDE-0E3AD0A9A666"
Public Const InterfaceId As String =
"4A60BD8A-41FF-407E-BDF5-1962BA23E70A"
Public Const EventsId As String = "B1D20E70-59D6-4D1C-B566-7F227F0119D1"
#End Region
' A creatable COM class must have a Public Sub New()
' with no parameters, otherwise, the class will not be
' registered in the COM registry and cannot be created
' via CreateObject.
Public Sub New()
MyBase.New()
End Sub
Private csError As String ' stores the error message
Public ReadOnly Property ErrorMsg() As String
Get
Return csError
End Get
End Property
Public Function Concat(ByVal str1 As String, ByVal str2 As String) As
String
Return Concat = str1 & " " & str2
End Function
End Class