473,398 Members | 2,404 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,398 software developers and data experts.

__property strangeness behavious

Hi,

If I make a __gc type with __property set and get I set them to private:,
those 2 methods are private ok but the actual generated property is public
according to the object browser yet its not visible in C#. WTF?

What kind of tosh is this ?


Nov 17 '05 #1
4 1080
Hi,

Thank you for posting in the community!

We have reviewed this issue and are currently working on it. We will reply
to you ASAP. Thanks for your patience!

Kevin Yu
=======
"This posting is provided "AS IS" with no warranties, and confers no
rights."

Nov 17 '05 #2
> If I make a __gc type with __property set and get I set them to
private:,
those 2 methods are private ok but the actual generated property is public
according to the object browser yet its not visible in C#. WTF?

What kind of tosh is this ?


Properties themselves are just metadata. No more.
With that, properties have no accesibility themselves; however, the methods
that conform it *do* have.

When you write in any .NET language a call to a property (say, to get it's
value), what actually is generated is a direct call to the corresponding
method (i.e. get_XXX in this case); that's it. So, if you make them private,
then no one will be able to call them outside the class.

--
Tomas Restrepo
tomasr@<mvps.org
Nov 17 '05 #3
Tell that to the object browser :D

Meh I just hate C++ becoming Kludge++

"Tomas Restrepo (MVP)" <to****@mvps.org> wrote in message
news:#W*************@TK2MSFTNGP09.phx.gbl...
If I make a __gc type with __property set and get I set them to private:,
those 2 methods are private ok but the actual generated property is public according to the object browser yet its not visible in C#. WTF?

What kind of tosh is this ?


Properties themselves are just metadata. No more.
With that, properties have no accesibility themselves; however, the

methods that conform it *do* have.

When you write in any .NET language a call to a property (say, to get it's
value), what actually is generated is a direct call to the corresponding
method (i.e. get_XXX in this case); that's it. So, if you make them private, then no one will be able to call them outside the class.

--
Tomas Restrepo
tomasr@<mvps.org

Nov 17 '05 #4
Hi,

Thanks for posting in the community.

MVP Tomas figured out:
Properties themselves are just metadata. No more. Tell that to the object browser :D


yes, it seems a little inconsistent of the property entry in the Object
Browser in VS.NET IDE.

Thanks!

Best regards,

Gary Chang
Microsoft Online Partner Support

Get Secure! - www.microsoft.com/security
This posting is provided "AS IS" with no warranties, and confers no rights.
--------------------

Nov 17 '05 #5

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

Similar topics

2
by: Ethel Aardvark | last post by:
I have a query which runs fine in SQL*Plus but which will not compile into a packaged procedure (claiming that the table can not be found): SELECT DISTINCT Folder_ID INTO l_RootID -- remove...
2
by: Robert M. Gary | last post by:
I'm using JRE 1.5 on Solaris Japanese (Sparc). The JVM claims its default character set is EUC-JP I'm seeing two strange things when using Japanese character sets... 1) If I write a program that...
7
by: | last post by:
Borland dumped all its "Borand C++ Builder" (BCB) customers. So it is our term to dump Borland (not only BCB). As a part of my attempt to dump long-loved BCB I'm trying to investigate how one can ...
0
by: Edward Diener | last post by:
Since a __property can be split between a read access and a write access property in MC++, how does one set an attribute on a __property ? Is setting an attribute before either the read access...
6
by: | last post by:
With the below example (taken from MSDN).. This also makes visible the set_Size and get_Size methods, and generates the Size property as we normally see it. Why didnt the get_ and set_...
3
by: Julie | last post by:
What would you expect from the following: enum Type { a, b, c }; public __gc class MClass { public: MClass(Type t); __property void set_Type(Type t); // etc.
0
by: Carl | last post by:
I started using managed C++ properties the standard way. E.g. __property void set_Value (Double Value) { m_Value=Value; } __property bool set_Value (Double Value) { if ( Value < 0 ) return...
9
by: Christian Kaiser | last post by:
Hmmm. I just got the following compiler messages: test_cpp.cpp d:\src\logsolar\datasources\test_cpp\test_cpp.h(18) : error C3760: please use __property keyword to declare property in managed...
2
by: vimalankvk80 | last post by:
#include <iostream> using namespace std; class A { private: int a; int b;
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
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,...
0
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...
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
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...
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...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.