"Oenone" <oe****@nowhere.com> schrieb:
\\\
Dim list As IList
Dim collName As String
collName = "System.Collections.ArrayList"
list =
DirectCast(Activator.CreateInstance(System.Type.Ge tType(collName)), IList)
///
However, when I set collName to "Microsoft.VisualBasic.Collection" (to get
one of the old VB6-style collections), System.Type.GetType() returns
Nothing. Do you know why?
It doesn't know which assembly the type is defined in. You'll have to know
the assembly which contains the type:
\\\
Dim o As Object
For Each a As [Assembly] In AppDomain.CurrentDomain.GetAssemblies()
If a.FullName.StartsWith("Microsoft.VisualBasic,") Then
o = a.CreateInstance("Microsoft.VisualBasic.Collection ")
Exit For
End If
Next a
///
--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>