J
jg
I followed the pattern in the MSDN dot net example for .net server and I
tried a making simple .net dll as COM from
Option Explicit On
Option Strict On
Imports System
Imports System.Text.RegularExpressions
Imports System.Text.Encoding
Imports System.Reflection
Public Interface ISomeClass
' Property OpeningBalance() As Double
Function test(ByVal strIn As String, ByVal intIn As Integer) As String
End Interface
Public Class SomeClass
Implements ISomeClass
Public Sub New()
End Sub
Public Function test(ByVal strIn As String, ByVal intIn As Integer) As
String _
Implements ISomeClass.test
Dim lstr_test As String
lstr_test = "input string received: " + strIn + "\l\f intIn=" +
ToString(intIn)
Return lstr_test
End Function
End Class
I "built" the dll with Class template, Assmely Name as SomeClass, and
rootspace name as SomeClass, Startobject being (none) with Visual studio
2005 express for visul basic.
I also registered the typelib
regasm SomeClass.dll /tlb:SomClass.tlb
The vbscript is in the same directory of the dll and typlib. The code is
Dim objSomeClass
set objSomeClass = CreateObject("SomeClass.ISomeClass") <= error not
found
Dim ll_pos, lstr_result
ll_pos = 999
lstr_result = objSomeClass.test("TestIn", ll_pos)
wscript.msgbox "result="& lstr_result , vbOKOnly, "test SomeClass"
What can I do to make it work? Or the I sould not have used relection at
all but use explicit marshalling for late binding client?
tried a making simple .net dll as COM from
Option Explicit On
Option Strict On
Imports System
Imports System.Text.RegularExpressions
Imports System.Text.Encoding
Imports System.Reflection
Public Interface ISomeClass
' Property OpeningBalance() As Double
Function test(ByVal strIn As String, ByVal intIn As Integer) As String
End Interface
Public Class SomeClass
Implements ISomeClass
Public Sub New()
End Sub
Public Function test(ByVal strIn As String, ByVal intIn As Integer) As
String _
Implements ISomeClass.test
Dim lstr_test As String
lstr_test = "input string received: " + strIn + "\l\f intIn=" +
ToString(intIn)
Return lstr_test
End Function
End Class
I "built" the dll with Class template, Assmely Name as SomeClass, and
rootspace name as SomeClass, Startobject being (none) with Visual studio
2005 express for visul basic.
I also registered the typelib
regasm SomeClass.dll /tlb:SomClass.tlb
The vbscript is in the same directory of the dll and typlib. The code is
Dim objSomeClass
set objSomeClass = CreateObject("SomeClass.ISomeClass") <= error not
found
Dim ll_pos, lstr_result
ll_pos = 999
lstr_result = objSomeClass.test("TestIn", ll_pos)
wscript.msgbox "result="& lstr_result , vbOKOnly, "test SomeClass"
What can I do to make it work? Or the I sould not have used relection at
all but use explicit marshalling for late binding client?