G
Guest
I am having a problem accessing the members in a structure via an interface
and Class.
***Development Code***
Structure Person
Public Name as String
End Structure
Interface IData
Public Property Employee As Person
End Interface
Public Class MyObject
Implements IData
End Class
**************
***Client Code***
Sub Main
Dim m as New MyObject
m.Employee.Name = "John"
End
**************
The problem is with the m.Employee.Name = "John" line. The IDE tells me
that since it is non-shared, I can't assign a value to it.
Is this not the right way to use structures?
Thanks
and Class.
***Development Code***
Structure Person
Public Name as String
End Structure
Interface IData
Public Property Employee As Person
End Interface
Public Class MyObject
Implements IData
End Class
**************
***Client Code***
Sub Main
Dim m as New MyObject
m.Employee.Name = "John"
End
**************
The problem is with the m.Employee.Name = "John" line. The IDE tells me
that since it is non-shared, I can't assign a value to it.
Is this not the right way to use structures?
Thanks