Can't see structure data members from other classes

  • Thread starter Thread starter STom
  • Start date Start date
S

STom

I have a class declare like this:

<Serializable>Public Class Talk
Public Structure _localTalk
Public _iTalkNumber as Integer
End structure

End Class

I can see the structure from other classes, but I cannot see the internal
data member. I've also tried setting the internal data member to private and
created a public property, but I couldn't see that either.

What simplistic thing am I missing here?

Thanks.

STom
 
Depending on how your dev env is setup, you may need to shut down and
restart the referencing project before it will see the change. Check also
that the location of the last build of you dll is what the referencing
project is pointed to.

--Prester John
 
STom said:
I have a class declare like this:

<Serializable>Public Class Talk
Public Structure _localTalk
Public _iTalkNumber as Integer
End structure

End Class

I can see the structure from other classes, but I cannot see the internal
data member. I've also tried setting the internal data member to private and
created a public property, but I couldn't see that either.

What simplistic thing am I missing here?

The structure is only a "definition." If you want to access members you
have to instantiate one.
Tom
 
* "STom said:
I have a class declare like this:

<Serializable>Public Class Talk
Public Structure _localTalk
Public _iTalkNumber as Integer
End structure

End Class

I can see the structure from other classes, but I cannot see the internal
data member. I've also tried setting the internal data member to private and
created a public property, but I couldn't see that either.

The data member is part of the structure. You will have to create a
public property of type '_localTask' (ugly naming convention!). Why do
you declare the structure inside the class?
 
STom said:
I have a class declare like this:

<Serializable>Public Class Talk
Public Structure _localTalk
Public _iTalkNumber as Integer
End structure

End Class

I can see the structure from other classes, but I cannot see the
internal data member. I've also tried setting the internal data
member to private and created a public property, but I couldn't see
that either.

What simplistic thing am I missing here?

There is no object of type _localTalk.
 
You have to create a variable to the _localTalk structure before you can use
the public _iTalkNumber member.

Dim myStruct as New _localTalk

myStruct._iTalkNumber = 15
 
Herfried,

In regard to why I am declaring structures within my class.....

I have a dataset that has 4 records. The fields in the dataset are like,
Year1, Year2, Residual (decimal values)

For each of the records in the dataset, they are of a specific type, like
one row is the principal, the next row is the interest etc.

So, I thought to create a class that has 4 types, each of the types would
have the same properties , but I would be able to distinguish which type the
Year1 field was associated with.

I could then create a single instance of the class and then associate the 4
types with the individual dataset rows. Might not make much sense, I'm open
to suggestions.

Yes, the naming convention is ugly...have you seen the new suggested naming
conventions from Microsoft for .Net...I actually prefer something like m_int
or m_obj....but I'm dealing with the type of client that insist on running
FxCop and complaining about any warnings.

STom
 
Back
Top