Click here to Skip to main content
15,891,926 members
Home / Discussions / C#
   

C#

 
GeneralRe: How to call a base class virtual method instead Pin
Pete O'Hanlon2-Jul-07 10:58
mvePete O'Hanlon2-Jul-07 10:58 
GeneralRe: How to call a base class virtual method instead Pin
PIEBALDconsult2-Jul-07 11:37
mvePIEBALDconsult2-Jul-07 11:37 
GeneralRe: How to call a base class virtual method instead [modified] Pin
Luc Pattyn2-Jul-07 11:46
sitebuilderLuc Pattyn2-Jul-07 11:46 
GeneralRe: How to call a base class virtual method instead Pin
mschuckmann2-Jul-07 11:58
mschuckmann2-Jul-07 11:58 
GeneralRe: How to call a base class virtual method instead Pin
Luc Pattyn2-Jul-07 12:10
sitebuilderLuc Pattyn2-Jul-07 12:10 
GeneralRe: How to call a base class virtual method instead Pin
mschuckmann2-Jul-07 12:14
mschuckmann2-Jul-07 12:14 
GeneralRe: How to call a base class virtual method instead Pin
Weirdoz1210-Nov-09 17:59
Weirdoz1210-Nov-09 17:59 
AnswerRe: How to call a base class virtual method instead Pin
Luc Pattyn2-Jul-07 11:19
sitebuilderLuc Pattyn2-Jul-07 11:19 
Hi Matt !

I think you cant:

1.
if you have a Base object or a Base-derivative pointed to by a Base reference,
it will do the virtual call, as intended by the virtual keyword.

2.
there is the "base" keyword, but its use is restricted (see paragraph 7.5.8 in the C# ref man)
to a few places, all inside classes that derive from the base class.
So yoy cant do myObject.base.methodname()

Conclusion: the virtual stuff really hides the base methods/properties.
And my first impression is that is how it should be.
Why is it you want to get at the base implementation from outside of the class anyway ?

There is of course a trick to do it, by providing a Clone() method in the base class,
something that takes a Base or Base-derivative and creates a new Base object, equivalent
to the base-part of the object (similar to a copy constructor), stripping off all
specialization.


Smile | :)




GeneralRe: How to call a base class virtual method instead Pin
mschuckmann2-Jul-07 11:44
mschuckmann2-Jul-07 11:44 
GeneralRe: How to call a base class virtual method instead Pin
Luc Pattyn2-Jul-07 11:50
sitebuilderLuc Pattyn2-Jul-07 11:50 
GeneralRe: How to call a base class virtual method instead Pin
PIEBALDconsult2-Jul-07 11:58
mvePIEBALDconsult2-Jul-07 11:58 
GeneralRe: How to call a base class virtual method instead Pin
Luc Pattyn2-Jul-07 12:06
sitebuilderLuc Pattyn2-Jul-07 12:06 
GeneralRe: How to call a base class virtual method instead Pin
PIEBALDconsult2-Jul-07 13:35
mvePIEBALDconsult2-Jul-07 13:35 
GeneralRe: How to call a base class virtual method instead Pin
Luc Pattyn2-Jul-07 13:49
sitebuilderLuc Pattyn2-Jul-07 13:49 
QuestionHow many maximum Threads can be created in CLR Thread pool Pin
Tejashvini2-Jul-07 10:39
Tejashvini2-Jul-07 10:39 
AnswerRe: How many maximum Threads can be created in CLR Thread pool Pin
Pete O'Hanlon2-Jul-07 10:45
mvePete O'Hanlon2-Jul-07 10:45 
AnswerRe: How many maximum Threads can be created in CLR Thread pool Pin
Luc Pattyn2-Jul-07 10:48
sitebuilderLuc Pattyn2-Jul-07 10:48 
QuestionReturn multiple asynch calls synchronously? Pin
matsnas2-Jul-07 10:32
matsnas2-Jul-07 10:32 
AnswerRe: Return multiple asynch calls synchronously? Pin
Not Active2-Jul-07 11:05
mentorNot Active2-Jul-07 11:05 
QuestionSerialization: how to acess from one assembly to another Pin
Saikek2-Jul-07 9:10
Saikek2-Jul-07 9:10 
AnswerRe: Serialization: how to acess from one assembly to another Pin
Scott Dorman2-Jul-07 10:41
professionalScott Dorman2-Jul-07 10:41 
QuestionRich Texbox to HTML [modified] Pin
Gene Arnold2-Jul-07 8:17
Gene Arnold2-Jul-07 8:17 
QuestionHow to implement a SMTP/POP3 listener service to monitor email similar to anti-spam app? Pin
SirajP2-Jul-07 8:00
SirajP2-Jul-07 8:00 
QuestionDownloading file from remote location Pin
kaliem2-Jul-07 7:39
kaliem2-Jul-07 7:39 
AnswerRe: Downloading file from remote location Pin
Scott Dorman2-Jul-07 7:52
professionalScott Dorman2-Jul-07 7:52 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.