|
-
Jun 12th, 2002, 03:46 AM
#1
Thread Starter
Not NoteMe
In a class module, what is a 'friend' property (as opposed to public/private)?
Quotes:
"I am getting better then you guys.." NoteMe, on his leet english skills.
"And I am going to meat her again later on tonight." NoteMe
"I think you should change your name to QuoteMe" Shaggy Hiker, regarding NoteMe
"my sweet lord jesus. I've decided never to have breast implants" Tom Gibbons
Have I helped you? Please Rate my posts. 
-
Jun 12th, 2002, 03:56 AM
#2
By specifying another class as "friend" you allow that friend to call the functions and variables of your class.
-
Jun 12th, 2002, 03:57 AM
#3
The Friend statement only allows YOUR program / project to call the procedure.
I'll take 2 examples here...
Scenario 1 - I create a Public function "Func1" in a class module, then turn this into an ActiveX Dll for my project to use. I then install this program fully completed onto your pc.
Since I have made this "Func1" public, there's nothing to stop you adding the dll reference into vb, and calling that function.
Scenario 2 - I create the same function, but declare it with the Friend statement then add the class module inside my project rather than creating a dll separatly. This now means my project can call the code, and any other developer who wants to try & pinch it for use with their project can go & @*%# themselves !!!
-
Jun 12th, 2002, 03:59 AM
#4
Thread Starter
Not NoteMe
Thanks for the clear explanations.
Quotes:
"I am getting better then you guys.." NoteMe, on his leet english skills.
"And I am going to meat her again later on tonight." NoteMe
"I think you should change your name to QuoteMe" Shaggy Hiker, regarding NoteMe
"my sweet lord jesus. I've decided never to have breast implants" Tom Gibbons
Have I helped you? Please Rate my posts. 
-
Jun 12th, 2002, 05:04 AM
#5
Hyperactive Member
Originally posted by alex_read
It's about time I had a good old argument, I'll disagree with that one fatboy, I would say it's accessible from anywhere as long as it's in your project (see attached)
Agree, misleadi the jury m'lud.... my interpretation moves to scope of implementation...
Dont disagree with quoting MSDN tho, it often makes things clearer....

Best Bar.....
-
Jun 12th, 2002, 05:27 AM
#6
No harm done, to be honest, that sample was the first time I've used it myself anyways !!
-
Jun 12th, 2002, 05:31 AM
#7
Hyperactive Member
Originally posted by alex_read
No harm done, to be honest, that sample was the first time I've used it myself anyways !!
Not that easy 4 me to get off the hook ! I use friend functions alot but never reference them in the same project....ah still....
interesting thought though, I recall someone telling me you can set a class member as hidden somewhere but cant remember how....any ideas ?

Best Bar.....
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|