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++ / September 2005

Tip: Looking for answers? Try searching our database.

Typedef in Managed C++

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Shane Bush - 28 Sep 2005 20:08 GMT
I'm trying to expose a typedef from an assembly in a managed C++ code and
cannot seem to make it work. See following code below:

namespace MyTypedef
{
    public __gc class MyClass
    {
        public:
             bool b() {return true;}
     };

    typedef     MyClass     NewName;
}

When viewed from Idlasm.exe, all I see is MyClass. I cannot use the new
typedef NewName. It seems that NewName is not exposed. Is there a way to
expose it using some Extern keyword, etc. Some suggested that make NewName
to inherit from MyClass. This is not acceptable since this violates the need
to have typedef in the first place. Please help!
Ronald Laeremans [MSFT] - 29 Sep 2005 04:15 GMT
> I'm trying to expose a typedef from an assembly in a managed C++ code and
> cannot seem to make it work. See following code below:
[quoted text clipped - 15 lines]
> to inherit from MyClass. This is not acceptable since this violates the need
> to have typedef in the first place. Please help!

Typedefs are not exposable in metadata. You can use them inside the
assembly, but not outside.

Ronald Laeremans
Visual C++ team

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.