That would be fine, except that if A is declared Friend then anyone in the
current assembly would be able to access it. In the C++ example no class
other than Foo & Bar could access the private data.
class Foo
Friend a as integer
...
end class
class Bar
private f as new Foo
public sub New()
f.a = 10
end sub
end class
class OtherClass
private f as new Foo
public sub Subr()
f.a = 10
end sub
end class
Would still work, which is not what I am going for..............
(Also is this a top posting or bottom posting group - responding top since
that was how I was responded to)
"CJ Taylor" <no****@blowgoats.com> wrote in message
news:10*************@corp.supernews.com...
Well, you wont be able to access A because its declared private. A would
have to be declared Friend.
"Jeff Lindholm" <je*******@lindholm.org> wrote in message
news:M%********************@newssvr28.news.prodigy .com... Is there a way to allow C++ friend level access in a VB.NET object.
Simple C++ example.............
class Foo
{
friend class Bar;
private int a;
...
};
class Bar
{
private int b;
Bar(Foo f)
{
b = f.a; // accessing private data in Foo
}
...
};