|
web
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
How to pass a structure to a form subroutineStructure MyStruct Dim x As String Dim y As String End Structure In one of my form (Form1), I have this sub: Sub Test(byref XXX as MyStruct) ....... end sub I then try to pass in the structure by doing this: Dim mmm as MyStruct Form1.Text(mmm) The above caused an error when in the Sub declaration: This is the error: XXX cannot expose type MyStruct outside the project through class Form1 Can someone please help? TIA Young My first guess is that it's to do with what access you have declared
the struct as. I did cut and paste the error message into google and it came up with this: http://msdn.microsoft.com/en-us/library/90htzsex(VS.80).aspx Try declaring the struct public? (e.g. public structure MyStruct...) Matt Show quoteHide quote On May 5, 2:42 pm, "Young" <young10***@hotmail.com> wrote: > I've the following structure: > > Structure MyStruct > Dim x As String > Dim y As String > End Structure > > In one of my form (Form1), I have this sub: > > Sub Test(byref XXX as MyStruct) > > ...... > > end sub > > I then try to pass in the structure by doing this: > > Dim mmm as MyStruct > Form1.Text(mmm) > > The above caused an error when in the Sub declaration: > > This is the error: XXX cannot expose type MyStruct outside the project through class Form1 > > Can someone please help? > > TIA > Young Thanks.
<m***@djmatty.com> wrote in message news:2fede44a-364a-4c29-9055-03b4f8b8f2b2@d2g2000pra.googlegroups.com... My first guess is that it's to do with what access you have declaredthe struct as. I did cut and paste the error message into google and it came up with this: http://msdn.microsoft.com/en-us/library/90htzsex(VS.80).aspx Try declaring the struct public? (e.g. public structure MyStruct...) Matt Show quoteHide quote On May 5, 2:42 pm, "Young" <young10***@hotmail.com> wrote: > I've the following structure: > > Structure MyStruct > Dim x As String > Dim y As String > End Structure > > In one of my form (Form1), I have this sub: > > Sub Test(byref XXX as MyStruct) > > ...... > > end sub > > I then try to pass in the structure by doing this: > > Dim mmm as MyStruct > Form1.Text(mmm) > > The above caused an error when in the Sub declaration: > > This is the error: XXX cannot expose type MyStruct outside the project > through class Form1 > > Can someone please help? > > TIA > Young |
|||||||||||||||||||||||