Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Languages / Managed C++ / June 2006

Tip: Looking for answers? Try searching our database.

Why is this a C2327?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Noah Stein - 01 Jun 2006 19:50 GMT
I'm getting a C2327 on something along the lines of this:

public ref class A
{
public:
   virtual property String ^ DisplayName { String ^ get() override; }

   [System::ComponentModel::DisplayName("Type")]
   property Object ^ Type { Object ^ get(); }
};

I can't see why C2327 should apply. I'm guessing it falls into the category
explained by example b. I'm wondering why this shouldn't be allowed. Where
is the ambiguity?

This has some fairly big repurcussions if this is intentional. Does this
mean that I now have to avoid using any name as a property that might appear
as an attribute? How can I possibly know what attributes MS plans to add in
the future? What about 3rd party attributes? If I use a 3rd party library
that uses attributes, am I then supposed to go through my entire codebase
changing property names to eradicate the conflict?

Thanks,
Noah
Ben Voigt - 02 Jun 2006 16:59 GMT
> I'm getting a C2327 on something along the lines of this:
>
[quoted text clipped - 4 lines]
>
>    [System::ComponentModel::DisplayName("Type")]

have you tried using DisplayNameAttribute spelled out?

>    property Object ^ Type { Object ^ get(); }
> };
[quoted text clipped - 12 lines]
> Thanks,
> Noah
Noah Stein - 03 Jun 2006 03:04 GMT
>> I'm getting a C2327 on something along the lines of this:
>>
[quoted text clipped - 6 lines]
>
> have you tried using DisplayNameAttribute spelled out?

That works fine. Thanks.

Rate this thread:







Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.