Re: VB.NET COM DLL form a VBScript
- From: MicheleG <giuliani.mi@xxxxxxxxx>
- Date: Mon, 12 May 2008 03:37:57 -0700 (PDT)
OK I solved the problem.
Thanks to everyone who wrote me.
This is the solution:
----BEGIN OF CODE-------
Public Class Class1
Public Sub Importa(ByRef visum As Object, ByVal numPF as Integer)
Dim VisumCl as Object = visum
VisumCl.Net.Marking.Clear()
Dim spp as Object = VisumCl.Net.Marking
spp.Add(Ctype(VisumCl.Net.StopPoints.ItemByKey(numPF), Object))
End Sub
Public Sub New()
MyBase.New()
End Sub
End Class
--------------------END OF CODE------
As you can see, before adding an element
VisumCl.Net.StopPoints.ItemByKey(numPF) to the container
VisumCl.Net.Marking, I have to convert it to generic type Object. Now
all works correctly!
Obviously from the VBScript I execute the statements:
Set dllobject = CreateObject("ClassLibrary1.Class1")
dllobject.Importa comobjectname numPF
Moreover, I added the dll: ClassLibrary1.dll and Interop.VISUMLIB.dll
in the
main directory where I execute the VBScript and where is located the
VISUM.EXE (dependence of Interop.VISUMLIB.dll)
Thank to everyone who answered me!
.
- References:
- VB.NET COM DLL form a VBScript
- From: MicheleG
- Re: VB.NET COM DLL form a VBScript
- From: MicheleG
- Re: VB.NET COM DLL form a VBScript
- From: Michel Posseth [MCP]
- Re: VB.NET COM DLL form a VBScript
- From: MicheleG
- Re: VB.NET COM DLL form a VBScript
- From: Michel Posseth [MCP]
- VB.NET COM DLL form a VBScript
- Prev by Date: Re: Is there anything vb.net cannot handle?
- Next by Date: Compact all the minimized forms into 1 application tag
- Previous by thread: Re: VB.NET COM DLL form a VBScript
- Next by thread: Date converison
- Index(es):