Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Inheritance
Message
From
17/03/2010 14:58:26
 
General information
Forum:
ASP.NET
Category:
Other
Title:
Environment versions
Environment:
C# 2.0
Miscellaneous
Thread ID:
01455125
Message ID:
01455168
Views:
32
It took you long enough to join the club :o) Now you know how the rest of us feel at times... :o)


>I feel like a total idiot. Thank you for catching it.
>
>>You haven't instantiated an instance of MyDerivedClass (MyDerivedClass m_DerivedClass = new MyDerivedClass();)
>>>Hi,
>>>
>>>I am having a problem that I will try to present here is a simplified manner:
>>>
>>>
>>>public class MyBaseClass
>>>{
>>>    public DataSet myDataSet;
>>>    
>>>    public void MyMethod( string cStr )
>>>    {
>>>          // do something with the string cStr
>>>   }
>>>}
>>>
>>>public class MyDerivedClass : MyBaseClass
>>>{
>>>               // Nothing is this class, so far
>>> }
>>>
>>>public partial class frmMyForm : Form
>>>{
>>>   private string cStr
>>>   public MyDefirvedClass m_DerivedClass;
>>>
>>>   public frmMyForm()
>>>   {
>>>         InitializeComponent();
>>>         m_DerivedClass.MyMethod( cStr );                        //  !!! This where I get error Null Reference
>>>   }
>>>
>>>}
>>>
>>>
>>>Note that the when I type m_DerivedClass in the frmMyForm constructor the intellisense shows the methods (MyMethod among them) of the class MyBaseClass so I know that I have declared "using" correctly. Why do I get the Null Reference on call MyMethod() then?
>>>
>>>TIA
.·*´¨)
.·`TCH
(..·*

010000110101001101101000011000010111001001110000010011110111001001000010011101010111001101110100
"When the debate is lost, slander becomes the tool of the loser." - Socrates
Vita contingit, Vive cum eo. (Life Happens, Live With it.)
"Life is not measured by the number of breaths we take, but by the moments that take our breath away." -- author unknown
"De omnibus dubitandum"
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform