Okay, but explain to me....
How VB would accomplish this....
I want to allow a derived class to use a variable from my base class, but not directly, and not expose the method as a public one that any code could call it given the object.
The answer in C++ is to make the member private, and have a protected member function that can be called by the derived class. (Private members of the base are included in a derived class, but they cannot be accessed directly. Only through a protected member function (or public). Friend classes can also use the protected member, but only the base class that has the private member can access it directly. Encapsulation anyone? ;) I take that back, with what I like to call 'hacks', any code can still access it - but not through normal means. reinterpret_cast, etc....)
VB is for kiddies. (Power wise - otherwise, it's not. Don't take me wrong. ;) )
And if they absolutely wanted something VB compatible, I'll write a COM object in C++ and they can call it in VB. I don't need to learn VB. :p (That's all VB.NET,C#, and VC++ 7.0 with the extensions turned on is - not true objects - they're COM objects. Hello super slow Windows of the future. :rolleyes: Not to mention platform compatibility just went out the door for sure - goodbye Windows. )
Re: Okay, but explain to me....
Quote:
Originally posted by JamesSchumacher
How VB would accomplish this....
I want to allow a derived class to use a variable from my base class, but not directly, and not expose the method as a public one that any code could call it given the object.
The answer in C++ is to make the member private, and have a protected member function that can be called by the derived class. (Private members of the base are included in a derived class, but they cannot be accessed directly. Only through a protected member function (or public). Friend classes can also use the protected member, but only the base class that has the private member can access it directly. Encapsulation anyone? ;) I take that back, with what I like to call 'hacks', any code can still access it - but not through normal means. reinterpret_cast, etc....)
Wow!!!
I don't know how to accomplish that in VB -- much more in C++ because my knowledge in the latter is very elementary.
And I may not be able to accomplish that forever because I only deal with real problems such as budgets, forecast, sales distribution, sales territory planning, etc. from the smallest brick to the corporate level. That's the beauty of VB. It allows kiddies like me to solve real problems directly. :cool:
I don't know why some of the real men hardly accomplished the same 5 years ago. Probably (sorry, just a guess) because, before they could deal with the real problem, they have, first, to " … make the member private, and have a protected member function that can be called by the derived class. (Private members of the base are included in a derived class, but they cannot be accessed directly. Only through a protected member function (or public). Friend classes can also use the protected member, but only the base class that has the private member can access it directly…." etc, etc.
:D :D :D
Re: Okay, but explain to me....
Quote:
Originally posted by JamesSchumacher
How VB would accomplish this....
I want to allow a derived class to use a variable from my base class, but not directly, and not expose the method as a public one that any code could call it given the object.
The answer in C++ is to make the member private, and have a protected member function that can be called by the derived class. (Private members of the base are included in a derived class, but they cannot be accessed directly. Only through a protected member function (or public). Friend classes can also use the protected member, but only the base class that has the private member can access it directly. Encapsulation anyone? ;) I take that back, with what I like to call 'hacks', any code can still access it - but not through normal means. reinterpret_cast, etc....)
VB is for kiddies. (Power wise - otherwise, it's not. Don't take me wrong. ;) )
You can't do that in VB. But, you can use derived class, but it is not as well as in C++ language. Let's say that C++ encapsulation, derivation, polyphormism and all those class systems are the betters on the market; you cannot do as well in any other language, including java and Delphi...
JeffB