So I'm trying to build an executable. The project I'm running is building on X86.
When I build the project, everything seems fine and I get an executable. But the executable doesn't run. I get an error saying:
'child' is not a child control of this parent.
Followed by, Exception:
Class not registered (Exception from HRESULT: 0X80040154 (REGDB_E_CLASSNOTREG).
I made sure everything is X86 and I cleaned the solution and rebuilt. But I still get these errors. (I tried switching to X64 and Any PC and those options can't even located my DeviceBase.dll) When I started debugging, it took me straight to a specific function of the code.
protected override void Call(bool calling)
{
if (calling)
{
if (components != null)
{
components.Call();
}
}
//This is where I get the exception saying
//cannot access a called object
base.Call(calling);
}
The Stack trace gives me something like this:
Message=Cannot access a disposed object.
Object name: 'Icon'.
ObjectName=Icon
Source=System.Drawing
The components starts off as null, and calling is initially false. How can I handle this exception in a proper manner? Any advice is appreciated.