Properties with C++/CLI
Christian Weyer's presentation at IrishDev

Access Modifiers: C++/CLI vs C# vs VB

C# has an internal access modifier (VB: Friend) to allow access only within the assembly. C++/CLI defines all access with the public/protected/private keywords; this allows more options: 

C++ C# VB
public public public Public
protected protected protected Protected
private private private Private
public private internal Friend
public protected internal protected Protected Friend
protected private not possible not possible

With C++/CLI one access modifier defines the access within the assembly, the other one defines the outside access. The order doesn't matter: more access is always from inside. C# internal is done with C++/CLI public private: public within the assembly, private outside of the assembly. Protected within the assembly and private outside of the assembly is not possible with C#, but it is possible with C++/CLI.

Update Here



Feed You can follow this conversation by subscribing to the comment feed for this post.

Justin Shen

public private has been replaced by internal in the VC2005 tool refresh 's compiler when using public private access specifier,you will get a warning which tells you to use internal instead.

Christian Nagel

Justin, Thanks for the information. I'm just downloading the new build. Let's see what happened to protected private.

Christian Nagel's OneNotes

AUTHOR: Christian Nagel's OneNotes
DATE: 12/27/2004 10:34:00 AM

Verify your Comment

Previewing your Comment

This is only a preview. Your comment has not yet been posted.

Your comment could not be posted. Error type:
Your comment has been posted. Post another comment

The letters and numbers you entered did not match the image. Please try again.

As a final step before posting your comment, enter the letters and numbers you see in the image below. This prevents automated programs from posting comments.

Having trouble reading this image? View an alternate.


Post a comment

Your Information

(Name and email address are required. Email address will not be displayed with the comment.)