By specifying another class as "friend" you allow that friend to call the functions and variables of your class.
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 :D !!!
Thanks for the clear explanations.
Agree, misleadi the jury m'lud.... my interpretation moves to scope of implementation...Quote:
Originally posted by alex_read
It's about time I had a good old argument, :D 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)
Dont disagree with quoting MSDN tho, it often makes things clearer....
No harm done, to be honest, that sample was the first time I've used it myself anyways !! :D
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....Quote:
Originally posted by alex_read
No harm done, to be honest, that sample was the first time I've used it myself anyways !! :D
interesting thought though, I recall someone telling me you can set a class member as hidden somewhere but cant remember how....any ideas ?