Hi,
I have .dll with Form and ImageList component,
when I'm making instance, I got execption:

An unhandled exception of type 'System.Reflection.TargetInvocationException'
occurred in mscorlib.dll
Additional information: Exception has been thrown by the target of an
invocation.

at line:
this.imglToolBar.ImageStream =
((System.Windows.Forms.ImageListStreamer)(resources.GetObject("imglToolBar.I
mageStream")));

What is wrong?

thx in andvance

pawel

Re: Additional information: Exception has been thrown by the target of an invocation. by Andy

Andy
Wed Aug 18 11:18:32 CDT 2004

"Pawe³ Skowron" <pskowron@mail.atr.bydgoszcz.pl> wrote in message
news:ehUYhAJhEHA.3928@TK2MSFTNGP11.phx.gbl...
> Hi,
> I have .dll with Form and ImageList component,
> when I'm making instance, I got execption:
>
> An unhandled exception of type
'System.Reflection.TargetInvocationException'
> occurred in mscorlib.dll
> Additional information: Exception has been thrown by the target of an
> invocation.
>
> at line:
> this.imglToolBar.ImageStream =
>
((System.Windows.Forms.ImageListStreamer)(resources.GetObject("imglToolBar.I
> mageStream")));
>
> What is wrong?
>
> thx in andvance
>
> pawel
>

Those kind of errors are difficult to troubleshoot.

Put a try/catch around the code which makes the instance, and examine the
InnerException property of the TargetInvocationException. It should lead
you to a better description. My guess is that your GetObject call is
returning Null for some reason, and the cast is failing.

Best Regards,

Andy



Re: Additional information: Exception has been thrown by the target of an invocation. by Paweł

Pawe³
Fri Aug 20 11:27:07 CDT 2004

Any other suggestions?

> > Hi,
> > I have .dll with Form and ImageList component,
> > when I'm making instance, I got execption:
> >
> > An unhandled exception of type
> 'System.Reflection.TargetInvocationException'
> > occurred in mscorlib.dll
> > Additional information: Exception has been thrown by the target of an
> > invocation.
> >
> > at line:
> > this.imglToolBar.ImageStream =
> >
>
((System.Windows.Forms.ImageListStreamer)(resources.GetObject("imglToolBar.I
> > mageStream")));
> >
> > What is wrong?
> >
> > thx in andvance
> >
> > pawel
> >
>
> Those kind of errors are difficult to troubleshoot.
>
> Put a try/catch around the code which makes the instance, and examine the
> InnerException property of the TargetInvocationException. It should lead
> you to a better description. My guess is that your GetObject call is
> returning Null for some reason, and the cast is failing.
>
> Best Regards,
>
> Andy
>
>



Re: Additional information: Exception has been thrown by the target of an invocation. by Andy

Andy
Fri Aug 20 17:37:09 CDT 2004

"Pawe³ Skowron" <pskowron@mail.atr.bydgoszcz.pl> wrote in message
news:u3o5GKthEHA.3428@TK2MSFTNGP11.phx.gbl...
> Any other suggestions?

None from me. Did you try the InnerException thing, and not get any
meaningful information?

Best Regards,

Andy