Salve,
con VisualStudio 2005 Prof. Edition ho creato una libreria contenente le seguenti le classi
bjBase,ObjListaBase
Codice PHP:
Namespace objRedaz
Public Class objBase
Dim Object_id As Integer
Dim Name As String
Public Sub New()
Object_id = 0
Name = "-"
End Sub
Public Property Id() As Integer
Get
Return Object_id
End Get
Set(ByVal value As Integer)
Object_id = value
End Set
End Property
Public Property Nome() As String
Get
Return Name
End Get
Set(ByVal value As String)
Name = value
End Set
End Property
End Class
Public Class ObjListaBase
Dim Lista(6) As objBase
Public Property BaseId(ByVal indice) As Integer
Get
Return Lista(indice).Id
End Get
Set(ByVal value As Integer)
Lista(indice).Id = value
End Set
End Property
End Class
Vorrei quindi che ObjListaBase contenga un Array di oggetti di tipo objbase.
La libreria si compila senza problami, ma se in un nuovo modulo .vb che richiama la libreria scrivo:
Codice PHP:
Dim Lista1 As New LibObjCms.objRedaz.ObjListaBase
Lista1.BaseId(0) = 15
mi viene restituito l'errore:
Riferimento a un oggetto non impostato su un'istanza di oggetto.
alla riga:
Lista(indice).Id = value
Come posso quinid crerare una classe contenete un Array di oggetti definiti da me?
Grazie mielle