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

Christian

Comments

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
IP: 000.000.000.000
DATE: 12/27/2004 10:34:00 AM

The comments to this entry are closed.