G
Gamma
I'm trying to create a ListBox that holds list of currently running
processes. So I inherited from Process a classes named _Process, which
it's objects are to be held in the ListBox (I just overrode the
"ToString"). Using the "GetProcesses" method, I get Process[], that I
want to cast to _Process[]. So why do I get
"System.InvalidCastException" all the time ? ("Specified cast is not
valid")
using System.Diagnostics;
using System.Windows.Forms;
..
..
..
namespace dbg
{
public class _Process: Process
{
public override String ToString()
{
return this.ProcessName;
}
};
..
..
..
private void InitializeComponent() // of the ListBox
{
processes. So I inherited from Process a classes named _Process, which
it's objects are to be held in the ListBox (I just overrode the
"ToString"). Using the "GetProcesses" method, I get Process[], that I
want to cast to _Process[]. So why do I get
"System.InvalidCastException" all the time ? ("Specified cast is not
valid")
using System.Diagnostics;
using System.Windows.Forms;
..
..
..
namespace dbg
{
public class _Process: Process
{
public override String ToString()
{
return this.ProcessName;
}
};
..
..
..
private void InitializeComponent() // of the ListBox
{