Click here to Skip to main content
15,905,614 members
Home / Discussions / C#
   

C#

 
GeneralRe: c# API for converting XSL-FO to PDF and other formats Pin
Jon Rista23-Oct-02 21:29
Jon Rista23-Oct-02 21:29 
GeneralRe: c# API for converting XSL-FO to PDF and other formats Pin
Stephane Rodriguez.23-Oct-02 21:28
Stephane Rodriguez.23-Oct-02 21:28 
GeneralRe: c# API for converting XSL-FO to PDF and other formats Pin
Philip Fitzsimons24-Oct-02 6:32
Philip Fitzsimons24-Oct-02 6:32 
Generalquestion about override and accessing base class methods Pin
Marc Clifton23-Oct-02 8:30
mvaMarc Clifton23-Oct-02 8:30 
GeneralRe: question about override and accessing base class methods Pin
Mark Conger23-Oct-02 10:09
Mark Conger23-Oct-02 10:09 
GeneralRe: question about override and accessing base class methods Pin
Jon Rista23-Oct-02 18:42
Jon Rista23-Oct-02 18:42 
GeneralRe: question about override and accessing base class methods Pin
Mark Conger24-Oct-02 1:47
Mark Conger24-Oct-02 1:47 
GeneralRe: question about override and accessing base class methods Pin
Jon Rista26-Oct-02 10:27
Jon Rista26-Oct-02 10:27 
Sorry....let me see if I can clarify (based on my understanding of the original question).

From what I understood, the question was can you explicitly instantiate a virtual method of a base class from an instance of a subclass:

Quote-----
"and the instantiation:

OverrideClassB ocb=new OverrideClassB();

How can I access just the VirtualMethod in OverrideClassA? In C++, I used to be able to say ((OverrideClassA)ocb).VirtualMethod();, but this still invokes the "B" class method in C#."

ocb is an instance of OverrideClassB. In C++, you can do ((OverrideClassA)ocb).VirtualMethod() to explicitly call the virtual method of a base class on an instance of a subclass.

My response was stating the fact that the object base is only available in the class declaration. Its not available on the instance of a class. Therefor, its not possible to call base on an instance of a class, such as the instance ocb used above. Base is available in the definition of a class, not in an instance.

Example:

class BaseClass
{
    public virtual void Method()
    {
    }
}

class DerivedClass: BaseClass
{
    public override void Method()
    {
        // you have access to base here
        base.Method()
    }
}

DerivedClass dc = new DerivedClass();

// here, you do NOT have access to base
// you can only call the instances Method()
// but have no way of explicitly instantiating
// BaseClass.Method(). This is where the 
// question arose, if I understood it correctly.
dc.Method();


Hope that helps. Sorry for the misunderstanding.
GeneralCollection within a Collection and "loading" advice Pin
Paul Watson23-Oct-02 0:38
sitebuilderPaul Watson23-Oct-02 0:38 
GeneralRe: Collection within a Collection and "loading" advice Pin
Paul Riley23-Oct-02 0:52
Paul Riley23-Oct-02 0:52 
GeneralRe: Collection within a Collection and "loading" advice Pin
Paul Watson23-Oct-02 1:19
sitebuilderPaul Watson23-Oct-02 1:19 
GeneralRe: Collection within a Collection and "loading" advice Pin
Paul Riley23-Oct-02 1:26
Paul Riley23-Oct-02 1:26 
GeneralRe: Collection within a Collection and "loading" advice Pin
Paul Riley23-Oct-02 1:32
Paul Riley23-Oct-02 1:32 
GeneralRe: Collection within a Collection and "loading" advice Pin
James T. Johnson23-Oct-02 0:53
James T. Johnson23-Oct-02 0:53 
GeneralRe: Collection within a Collection and "loading" advice Pin
Paul Watson23-Oct-02 1:13
sitebuilderPaul Watson23-Oct-02 1:13 
GeneralRe: Collection within a Collection and "loading" advice Pin
James T. Johnson23-Oct-02 1:20
James T. Johnson23-Oct-02 1:20 
GeneralRe: Collection within a Collection and "loading" advice Pin
Paul Watson23-Oct-02 1:59
sitebuilderPaul Watson23-Oct-02 1:59 
GeneralRe: Collection within a Collection and "loading" advice Pin
James T. Johnson23-Oct-02 2:28
James T. Johnson23-Oct-02 2:28 
GeneralRe: Collection within a Collection and "loading" advice Pin
Paul Watson23-Oct-02 3:12
sitebuilderPaul Watson23-Oct-02 3:12 
GeneralRe: Collection within a Collection and "loading" advice Pin
James T. Johnson23-Oct-02 3:26
James T. Johnson23-Oct-02 3:26 
GeneralRe: Collection within a Collection and "loading" advice Pin
Daniel Turini23-Oct-02 1:23
Daniel Turini23-Oct-02 1:23 
GeneralRe: Collection within a Collection and "loading" advice Pin
Paul Watson23-Oct-02 2:05
sitebuilderPaul Watson23-Oct-02 2:05 
GeneralRe: Collection within a Collection and "loading" advice Pin
Daniel Turini23-Oct-02 2:22
Daniel Turini23-Oct-02 2:22 
GeneralRe: Collection within a Collection and "loading" advice Pin
Jon Rista23-Oct-02 18:33
Jon Rista23-Oct-02 18:33 
GeneralRe: Collection within a Collection and "loading" advice Pin
Paul Watson23-Oct-02 21:19
sitebuilderPaul Watson23-Oct-02 21:19 

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.