Hi,
I have Project1 in which I have frmBase. I compiled the code and then
added an inherited form(frmChild) to the project which inherits from
frmBase. When I open the designer for frmChild the designer throws an
exception, "Object reference not set to an instance of an object."

Please help, what should I do to use inheritance within a project.

Thanx,
Debi

RE: Inherited Form Designer gives Exception by AlexKorchemniy

AlexKorchemniy
Mon Oct 18 16:23:03 CDT 2004

Just go through your core and make sure that the base form doesn't create
anything during design time that would throw an exception. For example, you
might have a data class trying to connect to a database but you depend on
some login object that was never instantiated. During runtime the base form
works but during designtime it fails.

---
Alex Korchemniy

"Debi" wrote:

> Hi,
> I have Project1 in which I have frmBase. I compiled the code and then
> added an inherited form(frmChild) to the project which inherits from
> frmBase. When I open the designer for frmChild the designer throws an
> exception, "Object reference not set to an instance of an object."
>
> Please help, what should I do to use inheritance within a project.
>
> Thanx,
> Debi

RE: Inherited Form Designer gives Exception by debi

debi
Mon Oct 18 16:31:01 CDT 2004

frmBase is a blank form. The exception message is "An exception occured while
trying to create an instance of frmBase." Both forms are in the same project.

"Alex Korchemniy" wrote:

> Just go through your core and make sure that the base form doesn't create
> anything during design time that would throw an exception. For example, you
> might have a data class trying to connect to a database but you depend on
> some login object that was never instantiated. During runtime the base form
> works but during designtime it fails.
>
> ---
> Alex Korchemniy
>
> "Debi" wrote:
>
> > Hi,
> > I have Project1 in which I have frmBase. I compiled the code and then
> > added an inherited form(frmChild) to the project which inherits from
> > frmBase. When I open the designer for frmChild the designer throws an
> > exception, "Object reference not set to an instance of an object."
> >
> > Please help, what should I do to use inheritance within a project.
> >
> > Thanx,
> > Debi

RE: Inherited Form Designer gives Exception by debi

debi
Mon Oct 18 18:33:01 CDT 2004

Actually I have code in Baseform Resize event which is causing the exception.

Resize calls a function after checking the window size and a variable. No
idea why this is causing exception. There is no data access.

"Debi" wrote:

> frmBase is a blank form. The exception message is "An exception occured while
> trying to create an instance of frmBase." Both forms are in the same project.
>
> "Alex Korchemniy" wrote:
>
> > Just go through your core and make sure that the base form doesn't create
> > anything during design time that would throw an exception. For example, you
> > might have a data class trying to connect to a database but you depend on
> > some login object that was never instantiated. During runtime the base form
> > works but during designtime it fails.
> >
> > ---
> > Alex Korchemniy
> >
> > "Debi" wrote:
> >
> > > Hi,
> > > I have Project1 in which I have frmBase. I compiled the code and then
> > > added an inherited form(frmChild) to the project which inherits from
> > > frmBase. When I open the designer for frmChild the designer throws an
> > > exception, "Object reference not set to an instance of an object."
> > >
> > > Please help, what should I do to use inheritance within a project.
> > >
> > > Thanx,
> > > Debi

RE: Inherited Form Designer gives Exception by debi

debi
Mon Oct 18 19:51:03 CDT 2004

I was referring to the MdiParent in the base form. That was causing the error.

"Alex Korchemniy" wrote:

> Just go through your core and make sure that the base form doesn't create
> anything during design time that would throw an exception. For example, you
> might have a data class trying to connect to a database but you depend on
> some login object that was never instantiated. During runtime the base form
> works but during designtime it fails.
>
> ---
> Alex Korchemniy
>
> "Debi" wrote:
>
> > Hi,
> > I have Project1 in which I have frmBase. I compiled the code and then
> > added an inherited form(frmChild) to the project which inherits from
> > frmBase. When I open the designer for frmChild the designer throws an
> > exception, "Object reference not set to an instance of an object."
> >
> > Please help, what should I do to use inheritance within a project.
> >
> > Thanx,
> > Debi