Using .NET dll in vbscript

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
 
R

Rich P

I have had a similar problem where you don't get the properties in the
dropdown listing from your .net dll if you are using it in an Access
code module. You won't get any dropdowns in VBscript. But if I create
the same dll in a VB6 activeX dll, then I get the properties. I believe
the problem is that there is no interface between .Net coding and com
coding. An activeX dll is a com dll. A .Net dll is not a com dll
therefore, you don't get the dropdowns. You just have to know the
properties that are there in your dll. At least, that has been my
experience, and I have posted on this with no results.

Rich
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top