Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 630
  • Last Modified:

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?
0
jackjohnson44
Asked:
jackjohnson44
1 Solution
 
ZeonFlashCommented:
Does your initInput need to be Public?  If not, set it to Private and it works.
0
 
jackjohnson44Author Commented:
yes, it does
0
 
Jeff CertainCommented:
I'd play with a couple things...

1. Try declaring singleStep as Public Shared.
2. Move the singleStep into the ctrlMyControl class.
0
 
Jeff CertainCommented:
Check that... option 2 works; option 1 doesn't
0
 
Mike TomlinsonMiddle School Assistant TeacherCommented:
Not at my puter right now...but I believe putting Public in front of your Module declaration may help:

Public Module ModStructures
    ....
End Module
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Tackle projects and never again get stuck behind a technical roadblock.
Join Now