Questions tagged [inherited]

This tag refers to the classes or objects that a particular class inherits from.

Use this tag for questions related to what is inherited by a class.

99 questions
1
vote
1 answer

Delphi Form and Generics

I have a problem, see if you can help me. I have a base form. type TForm_Base = class(TForm) oObjectoVO : TObject; ... procedure Search; ... procedure TForm_Base.Search; begin …
Neghetty
  • 13
  • 2
1
vote
3 answers

How to delete inherited objects values in Javascript?

I fetch user Result from database(Mongodb using Mongoose) in Nodejs. Now I want to delete some keys in the user Result. But unable to delete its property. I searched many times but didn't find any solution to delete Example:- File1.js Fetched user…
VIKAS KOHLI
  • 8,164
  • 4
  • 50
  • 61
1
vote
1 answer

C++ linker error when using same .h-file in inherited class

I have two classes: ClassA and ClassB. ClassB inherits the ClassA. There is a utility.h-header file included to both classa.cpp and classb.cpp so that I can use the method round(double number, int precision) from the utilities.h in both…
Canna
  • 13
  • 2
1
vote
2 answers

Base class on the initialisation list of a derived class' copy constructor (C++)

Let the example be: class Base { Base (const Base & copyFrom) { globalRegister (* this); } } class Derived { Derived (const Derived & copyFrom) : Base (copyFrom) {} } I've read suggestions to include the Base's copy constructor on the…
Jānis Elmeris
  • 1,975
  • 1
  • 25
  • 43
1
vote
0 answers

How to stop execution after inherited call?

I use TAdvGlowButton button control from TMS and by default it sets Down property to true on MouseDown. I would like to be able to prevent setting this property to True, when needed. The execution flow on MouseDown starts in the MouseDown procedure…
Mike Torrettinni
  • 1,816
  • 2
  • 17
  • 47
1
vote
0 answers

Passing Parameter From Child Class Constructor to Base Class Constructor

and thank you for your help. This is my first time posting! I'm trying to pass a Square class constructor to the Rectangle class constructor, and I get the following error: Square.cpp:9: error: redefinition of ‘Square::Square(double)’ …
KernelBomb
  • 11
  • 1
1
vote
1 answer

Having a base class's method use inherited class's static member variable... possible?

Base class: class SavingsAccount { public: void AddInterest(); // add interest to balance based on APR (interest rate) private: static double APR; double Balance; } class CheckingAccount: public SavingsAccount { private: static…
Kyle G.
  • 870
  • 2
  • 10
  • 22
1
vote
0 answers

C# Inherit VScrollBar, OnPaint() will not fire correctly

I've created a new class and inherited VScrollBar. I've created an override for OnPaint however it never fires. I've discovered VScrollBar is a wrapper for ScrollBar control, but I don't know how to work around this. public class MyScrollBar :…
Aerith
  • 337
  • 3
  • 11
1
vote
2 answers

How to customize flash message based on success or failure with Inherited Resources Rails plugin?

I'm using the inherited resources plugin in a 2.3.5 Rails application and was wondering how to change the flash[:notice] (or any other flash) based on the success OR failure in my create and update actions. So given the below, how do I add…
wgpubs
  • 8,131
  • 15
  • 62
  • 109
1
vote
1 answer

Get an instance for each class that implements an Interface

In order to solve a problem that I have in my solution using reflection, I need to specify the following code to show the user a CheckedListBox which exposes a list of conditions that they have to choose, and according with their choose it modifies…
Mauro Bilotti
  • 5,628
  • 4
  • 44
  • 65
1
vote
1 answer

How to improve ugly catch block using exception instanceof

Please pay attention: caller throws parentexception only!! Say that aexception, and bexception inherit from parentexception. In method af, it throws aexception, bexception and parentexception. void af() throws aexception, bexception, parentexception…
1
vote
2 answers

Methods that inherit data types from a method before them?

I would like to know how I can get the return value of a method and use it in another directly following it. For instance let's say I did this: public Integer multiply(Integer n1, Integer n2){ return n1 * n2; } //I know this is wrong but I…
1
vote
3 answers

Inherited Class Problems

I have the next code and i dont know how to solve the mult function. the compiler send me a message cannot declare parameter 'a' to be of type 'Matriz' I'm supposed to use exactly the code that is in the main The message is cannot declare…
KarlaE
  • 27
  • 5
1
vote
1 answer

how to call inherited constructor of TObjectDictionary in Delphi

I created the following class, after reading about the significant performance improvement of TDictionary over TStringList: TAnsiStringList = class(TObjectDictionary) public constructor Create(const OwnsObjects:…
DelphiCoder
  • 95
  • 1
  • 7
1
vote
2 answers

C# How to access inherited object from parent List

I'm trying to find a way to make a list of parent object with a variety of inherited objects. Here is an example. class Prog { public Prog ( ) { List shapes = new List(); shapes.Add( new Cube() ); …
Munsta0
  • 121
  • 1
  • 7