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++ / May 2004

Tip: Looking for answers? Try searching our database.

__property set_ naming issue (managed C++)

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Julie - 27 May 2004 22:15 GMT
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.
};

When compiling, I get very strange errors (in this case, for the constructor)
where the Type type is compiled as the managed Type property.  It is an easy
fix, although the compiler diagnostic is far from intuitive.

Comments?
Tomas Restrepo \(MVP\) - 28 May 2004 00:42 GMT
Hi Julie,

> What would you expect from the following:
>
[quoted text clipped - 13 lines]
>
> Comments?

What errors are you getting? Compiling your sample code, I get:
t.cpp
t.cpp(9) : error C2872: 'Type' : ambiguous symbol
       could be 't.cpp(4) : Type'
       or       't.cpp(1) : System::Type'
t.cpp(10) : error C2872: 'Type' : ambiguous symbol
       could be 't.cpp(4) : Type'
       or       't.cpp(1) : System::Type'

which actually seems like a very good diagnostic message.

Signature

Tomas Restrepo
tomasr@mvps.org

Julie - 28 May 2004 01:22 GMT
"Tomas Restrepo (MVP)" wrote:

> Hi Julie,
>
[quoted text clipped - 28 lines]
>
> which actually seems like a very good diagnostic message.

My mistake --

Type should be MyType in all instances.
Tomas Restrepo \(MVP\) - 28 May 2004 02:14 GMT
Hi Julie,

> My mistake --
>
> Type should be MyType in all instances.

Meaning this, then?

#using <mscorlib.dll>
using namespace System;

enum MyType { a, b, c };

public __gc class MClass
{
public:
 MClass(MyType t);
 __property void set_Type(MyType t);
 // etc.
};

Compiles fine for me :|

Signature

Tomas Restrepo
tomasr@mvps.org


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.