473,387 Members | 1,540 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Friends in VB.NET vs C++

in c++ i could declare classA a friend of classB, and this
would allow classA to access anything in classB
can i do this in VB?
i notice that the friends keyword functions more like the
old Global keyword
Jul 19 '05 #1
2 4290
yeah ok
that is close then, but i dont want _everything_ to be
able to access the data, just one particular class

i have a class and a form object/class
the form is intended to fill out the information required
for an instance of the class
it would be nice if i could give the form access to the
classes data members, since it has a special relationship
with the class

-----Original Message-----
Well, Friend in VB .NET let's any other class/assembly in your projectaccess the data in the class declared with this keyword.

--
Carsten Thomsen
Enterprise Development with Visual Studio .NET, UML, and MSFhttp://www.apress.com/book/bookDisplay.html?bID=105
"Dave Cousineau" <sa******@shaw.ca> wrote in message
news:04****************************@phx.gbl...
in c++ i could declare classA a friend of classB, and this would allow classA to access anything in classB
can i do this in VB?
i notice that the friends keyword functions more like the old Global keyword

.

Jul 19 '05 #2
I believe that you need to use nested classes for this. E.g.,

Public Class ParentClass
...

Private Class ChildClass
...
End Class

End Class

That way, ChildClass can only be accessed from ParentClass.

Check out these threads:

http://groups.google.com/groups?hl=e...ublic.dotnet.*

Jul 19 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

11
by: Sean Don | last post by:
Hello! Is it possible to make classes friends in Python? Or is it better to just stick to "Java style" .isThis, .getThat, .setThis style functions? I understand that classes are generally...
4
by: jr | last post by:
I'm currently using the msnp.py code from Manish Jethani's project. I havn't been able to get the friends list to update like it should. it works once out of about every 25 times the program loads....
11
by: Micha | last post by:
Hello there, I think I've run into some classic c++ pitfall and maybe some of you guys can help me out. For my project I will need to use matrices and vectors and so I decided to implement them...
6
by: (Pete Cresswell) | last post by:
I'm makeing a little DB to help manage high school class reunions. One feature I'm trying to implement is "Friends". e.g. Fred Smith is a friend of Joe Jones and Bill Anderson. We record...
11
by: zhangzhan | last post by:
hello.everyone,i am an chinese.i study in shanxi unniversity,as i like english very much,i also wanr to make friends with a foriger. .....i really don't kown what i should to say ,as i first came...
0
by: goosen_cug | last post by:
hello.everyone,i am an chinese.i study in China University of Geosiences,as i like english and C++(program) very much,i also want to make friends with a foriger to improve my english and the...
1
by: goosen_cug | last post by:
hello.everyone,i am an chinese.i study in China University of Geosiences,as i like english and C++(program) very much,i also want to make friends with a foriger to improve my english and the...
3
by: shaun roe | last post by:
Hello, I am working in a framework with certain restrictions; in particular I have a 'data' class with getter and setter methods, and a some 'filling' classes which know how to insert the data to...
1
by: KittenKoder | last post by:
Basically I'm trying to parse my friends page on MySpace. It's easy to get Page 1. I can use "MSXML2.ServerXMLHTTP" to get the page and parse all my friends. The question is, how do I get page 2...
2
by: LeXave | last post by:
Hi all I've got the following problem in my database structure : I have a table "User". Each user can have one or more friends which are users too. And I have no idea about the way I must think...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.