Hello,
I created a public Structure in a Standard Module and also
an array of Structures. Then I load data into the array
of structures in a public sub that I call on the Form load
event. Next I have a class, and I want to pass a
structure member from my array of Structures to the class
constructor. In the form I instantiate a class object.
Module1
--------------------------
Public arrStruct() As structOne
Public Structure structOne
....
End Structure
public sub LoadStruct()
....
End Sub
-----------------------------
Form1
form_load event
LoadStruct
....
Dim clsOne(arrStruct(1)) As New Class1
In the class constructor I have this:
Public Class Class1
Public Sub New(ByVal strcOne As structOne)
var1 = strcOne.element1
var2 = strcOne.element2
...
End Sub
....
The compile error I get is
'strcOne' cannot expose a Friend type outside of the
Public class 'Class1'. strcOne is the the argument in the
constructor for Class1. When I instantiate Class1 as
clsOne I pass a member of my array of Structures,
arrStruct(1) where the member is a structure.
Is there anything I can do to get around this error?
Thanks,
Steve