Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. General Programming
  3. Managed C++/CLI
  4. How to call base class method

How to call base class method

Scheduled Pinned Locked Moved Managed C++/CLI
csharpc++tutorialquestion
4 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    s196675m
    wrote on last edited by
    #1

    From inside the overriden virtual function of a derived class, how can I call the base class function. The C# equivalent is base.SomeVirtualFunction(); I need VC++ managed equivalent. Thank you.

    M 1 Reply Last reply
    0
    • S s196675m

      From inside the overriden virtual function of a derived class, how can I call the base class function. The C# equivalent is base.SomeVirtualFunction(); I need VC++ managed equivalent. Thank you.

      M Offline
      M Offline
      Mark Salsbery
      wrote on last edited by
      #2

      public ref class baseclass
      {
      public:
      virtual void virtualmethod()
      {
      }
      };

      public ref class derivedclass : public baseclass
      {
      public:
      virtual void virtualmethod() override
      {
      baseclass::virtualmethod();
      }
      };

      Mark Salsbery Microsoft MVP - Visual C++ :java:

      E 1 Reply Last reply
      0
      • M Mark Salsbery

        public ref class baseclass
        {
        public:
        virtual void virtualmethod()
        {
        }
        };

        public ref class derivedclass : public baseclass
        {
        public:
        virtual void virtualmethod() override
        {
        baseclass::virtualmethod();
        }
        };

        Mark Salsbery Microsoft MVP - Visual C++ :java:

        E Offline
        E Offline
        Eytukan
        wrote on last edited by
        #3

        You know it's really funny. C++/CLI forum is serving every other forum. All platform related things are being asked here taking the burden off C# & VB.net forums, and also the OO questions, freeing up the C++ forum :D


        OK,. what country just started work for the day ? The ASP.NET forum is flooded with retarded questions. -Christian Graus Best wishes to Rexx[^]

        M 1 Reply Last reply
        0
        • E Eytukan

          You know it's really funny. C++/CLI forum is serving every other forum. All platform related things are being asked here taking the burden off C# & VB.net forums, and also the OO questions, freeing up the C++ forum :D


          OK,. what country just started work for the day ? The ASP.NET forum is flooded with retarded questions. -Christian Graus Best wishes to Rexx[^]

          M Offline
          M Offline
          Mark Salsbery
          wrote on last edited by
          #4

          This board is so dead it makes me :zzz: :)

          Mark Salsbery Microsoft MVP - Visual C++ :java:

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups