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++ / August 2006

Tip: Looking for answers? Try searching our database.

A native 'public class' or 'private class' in VC8

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Edward Diener - 05 Aug 2006 06:35 GMT
Specifying 'public class' or 'private class' for C++ class definitions
is not part of the C++ standard. In a topic in the VS 2005 docs 'How to:
Declare public and private on Native classes', it is suggested that this
syntax is supported with VC8 for interaction with CLR ref classes and
for specifying in a CLR assembly.

However in the specific C++ language documentation for native classes,
there is no mention of the possibility of prepending 'class' with either
'public' or 'private'. Furthermore where it is explained in the first
topic above there is no explanation of what it actually means for native
classes, other than the implied suggestion that it treats native classes
like ref classes in CLR assemblies as regards the 'public' and 'private'
keywords in front of a ref class.

Can anybody clear up for me whether this is supported for native classes
in CLR assemblies and what it actually means given the abysmal MSDN
documentation on it ?
Holger Grund - 05 Aug 2006 20:51 GMT
> However in the specific C++ language documentation for native classes,
> there is no mention of the possibility of prepending 'class' with either
[quoted text clipped - 3 lines]
> like ref classes in CLR assemblies as regards the 'public' and 'private'
> keywords in front of a ref class.

The compiler emits value type definitions for native classes. Note
that these specify size and alignment only and the layout is done
at the C++ compiler's discretion. I guess, that was just a convenient
way to emit code from a lowered IR.

The access specifier controls the visibility of the generated value type.

-hg
bonk - 05 Aug 2006 22:38 GMT
Yes, EVERY (no matter if you use #pragma managed or #pragma unmanaged)
native class ends up as a managed value type in the assembly.

> Specifying 'public class' or 'private class' for C++ class definitions is
> not part of the C++ standard. In a topic in the VS 2005 docs 'How to:
[quoted text clipped - 13 lines]
> in CLR assemblies and what it actually means given the abysmal MSDN
> documentation on it ?

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.