jackjohnson44
asked on
vb.net pass structure into class function
I am trying to pass a public structure contained in a mod into a function in a control.
Module ModStructures
Public Structure singleStep
Public instrument As String
Public mode As String
Public paramater As String
Public label As String
Public inputType As String
Public value As String
Public options As String
End Structure
End Module
Public Class ctrlMyControl
Public Function initInput(ByVal stepObject As singleStep)
I am getting the error:
'stepObject' cannot expose type 'ModStructures.singleStep' outside the project through class 'ctrlMyControl'
What am I doing wrong?
Module ModStructures
Public Structure singleStep
Public instrument As String
Public mode As String
Public paramater As String
Public label As String
Public inputType As String
Public value As String
Public options As String
End Structure
End Module
Public Class ctrlMyControl
Public Function initInput(ByVal stepObject As singleStep)
I am getting the error:
'stepObject' cannot expose type 'ModStructures.singleStep'
What am I doing wrong?
Does your initInput need to be Public? If not, set it to Private and it works.
ASKER
yes, it does
I'd play with a couple things...
1. Try declaring singleStep as Public Shared.
2. Move the singleStep into the ctrlMyControl class.
1. Try declaring singleStep as Public Shared.
2. Move the singleStep into the ctrlMyControl class.
Check that... option 2 works; option 1 doesn't
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.