J
JP
Hi,
I am facing a strange problem, please take a look at the code below:
public SaveTree()
{
........
......
......//some code
Initranges()
}
protected virtual Initranges()
{
........//some code
.......
}
Somewhere else, i have a derived class:
public SaveSingleTree: SaveTree
{
.........
//constructor not being overridden
}
Now, when i do something like this:
SaveTree tree = new SaveSingleTree()
I get an exception with the following text:
'System.Reflection.TargetInvocationException' occurred in mscorlib.dl
Exception has been thrown by the target of an invocation.
i have a set of base class and derived class in which a protected
virtual function is being overridden by the derived class. This
function is called internally by the constructor of the base class and
the constructor is NOT being overridden by the derived class.
Anyone have any idea what am i doing wrong? can i invoke a virtual
function from inside a constructor?
Jaspinder
I am facing a strange problem, please take a look at the code below:
public SaveTree()
{
........
......
......//some code
Initranges()
}
protected virtual Initranges()
{
........//some code
.......
}
Somewhere else, i have a derived class:
public SaveSingleTree: SaveTree
{
.........
//constructor not being overridden
}
Now, when i do something like this:
SaveTree tree = new SaveSingleTree()
I get an exception with the following text:
'System.Reflection.TargetInvocationException' occurred in mscorlib.dl
Exception has been thrown by the target of an invocation.
i have a set of base class and derived class in which a protected
virtual function is being overridden by the derived class. This
function is called internally by the constructor of the base class and
the constructor is NOT being overridden by the derived class.
Anyone have any idea what am i doing wrong? can i invoke a virtual
function from inside a constructor?
Jaspinder