473,651 Members | 2,531 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Can't see structure data members from other classes

I have a class declare like this:

<Serializable>P ublic 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 1350
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******** ******@TK2MSFTN GP10.phx.gbl...
I have a class declare like this:

<Serializable>P ublic 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>P ublic 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>P ublic 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>P ublic 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._iTalk Number = 15

"STom" <st***********@ hotmail.com> wrote in message
news:uL******** ******@TK2MSFTN GP10.phx.gbl...
I have a class declare like this:

<Serializable>P ublic 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>P ublic 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
5722
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 is to improve, but not to prove.
13
7284
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( structure->bufferspace ) ). My question is, if I free just the structure, will the (e.g.) bufferspace be freed implicitly, or do I have to (as I currently am) free the members first? Thanks. -cjl
5
1689
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 overwritten, i.e. should not be part of the union. The remaining 2, UnionData1 and UnionData2, make up the union and are populated as needed. I want to be certain that this code will work as planned. Specifically, if the field offsets of the...
22
23347
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 examples?
9
37188
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 Win32_DiskDrive, but it doesn't seem to return any information on cdrom devices. I suspect there might be a Win32 API call, but I haven't found any info yet using Google. Is there a way to achieve this in C#?
6
1761
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 the individual elements in an array of ImageList's could be identified by the ID, thereby allowing re-ordering the array without harm. A person could identify by index into the array, but that would not be preserved by re-ordering (and re-ordering...
8
2017
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 like so: <Teachers> <Teacher> <Classes> <Class>
4
2558
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 error struct xxxx { static int i; // int j; };
5
35752
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 with no members. This makes sense because the only real use for a structure or class with no data members and virtual functions is as the base from which to derive other classes and structures or as a container for non-virtual methods. The reason...
0
8347
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8275
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8792
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8694
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8571
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
6157
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4143
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4280
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1905
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.