473,395 Members | 1,756 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

Can't see structure data members from other classes

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
Nov 20 '05 #1
6 1339
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" <st***********@hotmail.com> wrote in message
news:uL**************@TK2MSFTNGP10.phx.gbl...
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

Nov 20 '05 #2
"STom" <st***********@hotmail.com> wrote...
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
Nov 20 '05 #3
* "STom" <st***********@hotmail.com> scripsit:
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?

--
Herfried K. Wagner [MVP]
<http://www.mvps.org/dotnet>
Nov 20 '05 #4
"STom" <st***********@hotmail.com> schrieb
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.
--
Armin

http://www.plig.net/nnq/nquote.html
http://www.netmeister.org/news/learn2quote.html

Nov 20 '05 #5
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

"STom" <st***********@hotmail.com> wrote in message
news:uL**************@TK2MSFTNGP10.phx.gbl...
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

Nov 20 '05 #6
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
"Herfried K. Wagner [MVP]" <hi***************@gmx.at> wrote in message
news:bv************@ID-208219.news.uni-berlin.de...
* "STom" <st***********@hotmail.com> scripsit:
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?

--
Herfried K. Wagner [MVP]
<http://www.mvps.org/dotnet>

Nov 20 '05 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
by: alphatan | last post by:
Is there relative source or document for this purpose? I've searched the index of "Mastering Regular Expression", but cannot get the useful information for C. Thanks in advanced. -- Learning...
13
by: John | last post by:
In the course of an assignment, I learned the hard way that I shouldn't try to free a malloc'd member of a malloc'd structure after having freed that structure (i.e., free( structure ); free(...
5
by: Mike | last post by:
Within the following structure, TopStruct, I'd like to create 3 other structures, 2 of which make up a union. The first structure will always contain some data that I need and should never be...
22
by: Matthew Louden | last post by:
I want to know why C# doesnt support multiple inheritance? But why we can inherit multiple interfaces instead? I know this is the rule, but I dont understand why. Can anyone give me some concrete...
9
by: Paul Steele | last post by:
I am writing a C# app that needs to periodically poll for cdroms and usb storage device insertions. I've looked at the WMI functions but haven't found anything all that useful. The closest is...
6
by: Peter Oliphant | last post by:
I just discovered that the ImageList class can't be inherited. Why? What could go wrong? I can invision a case where someone would like to add, say, an ID field to an ImageList, possible so that...
8
by: a | last post by:
I'm trying to save data from a custom object into the profile object, but it is not structured the way that I want. I'm trying to get the custom object to serialize as xml to a Profile object...
4
by: sandeep | last post by:
Hi why we cannot have static as a structure member? & also is there any way to achive data hiding in C at this level( i.e. access only selected structure member ) following code gives syntax...
5
Banfa
by: Banfa | last post by:
I thought I would write a little article about this because it is regularly asked as a question in the Forums. Firstly this is a C++ issue, it is strictly against the rules of C to create a class...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.