473,396 Members | 1,921 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

ImageList won't load, throws exception

When ever I try to implement an ImageList, I always get an exception when
the application runs. The ImageList doesn't even have to be used by
anything. An empty ImageList doesn't throw!

The following exception is thrown by the following code.

*****
'System.Reflection.TargetInvocationException' occurred in mscorlib.dll

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

---code----
....
private System.Windows.Forms.ImageList ilMainFrame;
....

private void InitializeComponent()
{
....
this.ilMainFrame.ImageStream =
((System.Windows.Forms.ImageListStreamer)(resource s.GetObject
"ilMainFrame.ImageStream")));
....
}
....

The resource file the line for the iMainFrame.ImageStream looks like:

name value comment type
mimetype
ilMainFrame.ImageStream (null) (null)
application/x-microsoft.net.object.binary.base64

The mime coded image is in the .resx file. The element looks like:

<data name="ilMainFrame.ImageStream"
mimetype="application/x-microsoft.net.object.binary.base64">
<value>
.....
</value>
</data>

I am running VS 2003 on windows XP pro.

I have looked through MSDN, but no help.
If anyone has an answer please tell me, before I have to phone Microsoft
($$$$).
Chuck
Nov 15 '05 #1
4 4854
Could you provide more information about the exception, like the stack trace
and any subexceptions?
"Chuck" <ce*****@austin.rr.com> wrote in message
news:t0*******************@twister.austin.rr.com.. .
When ever I try to implement an ImageList, I always get an exception when
the application runs. The ImageList doesn't even have to be used by
anything. An empty ImageList doesn't throw!

The following exception is thrown by the following code.

*****
'System.Reflection.TargetInvocationException' occurred in mscorlib.dll

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

---code----
...
private System.Windows.Forms.ImageList ilMainFrame;
...

private void InitializeComponent()
{
...
this.ilMainFrame.ImageStream =
((System.Windows.Forms.ImageListStreamer)(resource s.GetObject
"ilMainFrame.ImageStream")));
...
}
...

The resource file the line for the iMainFrame.ImageStream looks like:

name value comment type mimetype
ilMainFrame.ImageStream (null) (null)
application/x-microsoft.net.object.binary.base64

The mime coded image is in the .resx file. The element looks like:

<data name="ilMainFrame.ImageStream"
mimetype="application/x-microsoft.net.object.binary.base64">
<value>
....
</value>
</data>

I am running VS 2003 on windows XP pro.

I have looked through MSDN, but no help.
If anyone has an answer please tell me, before I have to phone Microsoft
($$$$).
Chuck

Nov 15 '05 #2
No usable stack trace as the problem is occuring in InitializeComponent()
called by class constructor. No inside info available.

As there isn't a whole lot of complaining going on, I expect a configuration
problem somewhere.

"Daniel O'Connell" <onyxkirx@--NOSPAM--comcast.net> wrote in message
news:u5**************@TK2MSFTNGP12.phx.gbl...
Could you provide more information about the exception, like the stack trace and any subexceptions?
"Chuck" <ce*****@austin.rr.com> wrote in message
news:t0*******************@twister.austin.rr.com.. .
When ever I try to implement an ImageList, I always get an exception when the application runs. The ImageList doesn't even have to be used by
anything. An empty ImageList doesn't throw!

The following exception is thrown by the following code.

*****
'System.Reflection.TargetInvocationException' occurred in mscorlib.dll

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

---code----
...
private System.Windows.Forms.ImageList ilMainFrame;
...

private void InitializeComponent()
{
...
this.ilMainFrame.ImageStream =
((System.Windows.Forms.ImageListStreamer)(resource s.GetObject
"ilMainFrame.ImageStream")));
...
}
...

The resource file the line for the iMainFrame.ImageStream looks like:

name value comment

type
mimetype
ilMainFrame.ImageStream (null) (null) application/x-microsoft.net.object.binary.base64

The mime coded image is in the .resx file. The element looks like:

<data name="ilMainFrame.ImageStream"
mimetype="application/x-microsoft.net.object.binary.base64">
<value>
....
</value>
</data>

I am running VS 2003 on windows XP pro.

I have looked through MSDN, but no help.
If anyone has an answer please tell me, before I have to phone Microsoft
($$$$).
Chuck


Nov 15 '05 #3
Hrmm, being able to see where the failure is occuring within image list may
be of value, stricty based on a reflection exception I'm afraid there isn't
much I can do to help.
"Chuck" <ce*****@austin.rr.com> wrote in message
news:jE*********************@twister.austin.rr.com ...
No usable stack trace as the problem is occuring in InitializeComponent()
called by class constructor. No inside info available.

As there isn't a whole lot of complaining going on, I expect a configuration problem somewhere.

"Daniel O'Connell" <onyxkirx@--NOSPAM--comcast.net> wrote in message
news:u5**************@TK2MSFTNGP12.phx.gbl...
Could you provide more information about the exception, like the stack

trace
and any subexceptions?
"Chuck" <ce*****@austin.rr.com> wrote in message
news:t0*******************@twister.austin.rr.com.. .
When ever I try to implement an ImageList, I always get an exception when the application runs. The ImageList doesn't even have to be used by
anything. An empty ImageList doesn't throw!

The following exception is thrown by the following code.

*****
'System.Reflection.TargetInvocationException' occurred in mscorlib.dll

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

---code----
...
private System.Windows.Forms.ImageList ilMainFrame;
...

private void InitializeComponent()
{
...
this.ilMainFrame.ImageStream =
((System.Windows.Forms.ImageListStreamer)(resource s.GetObject
"ilMainFrame.ImageStream")));
...
}
...

The resource file the line for the iMainFrame.ImageStream looks like:

name value comment

type
mimetype
ilMainFrame.ImageStream (null) (null) application/x-microsoft.net.object.binary.base64

The mime coded image is in the .resx file. The element looks like:

<data name="ilMainFrame.ImageStream"
mimetype="application/x-microsoft.net.object.binary.base64">
<value>
....
</value>
</data>

I am running VS 2003 on windows XP pro.

I have looked through MSDN, but no help.
If anyone has an answer please tell me, before I have to phone Microsoft ($$$$).
Chuck



Nov 15 '05 #4
Jax
I got this a while ago, my problem was due to the fact i'd
put one of my classes in a folder but then removed the
folder prefix from it's namespace.
I'd assume it was a problem with the file which the image
list is in, rather then the image list itself.
Try loading other graphics with it to see if thats the
case.
I find that most of those kind of problems can be solved
by just moving things around in your project (don't ask me
how or why, it just does sometimes).

Hope thats vaguely useful
jax
-----Original Message-----
Hrmm, being able to see where the failure is occuring within image list maybe of value, stricty based on a reflection exception I'm afraid there isn'tmuch I can do to help.
"Chuck" <ce*****@austin.rr.com> wrote in message
news:jE*********************@twister.austin.rr.co m...
No usable stack trace as the problem is occuring in InitializeComponent()
called by class constructor. No inside info available.

As there isn't a whole lot of complaining going on, I expect a
configuration
problem somewhere.

"Daniel O'Connell" <onyxkirx@--NOSPAM--comcast.net>
wrote in message news:u5**************@TK2MSFTNGP12.phx.gbl...
> Could you provide more information about the exception, like the stack
trace
> and any subexceptions?
> "Chuck" <ce*****@austin.rr.com> wrote in message
> news:t0*******************@twister.austin.rr.com.. .
> > When ever I try to implement an ImageList, I always
get an exception when
> > the application runs. The ImageList doesn't even
have to be used by > > anything. An empty ImageList doesn't throw!
> >
> > The following exception is thrown by the following code. > >
> > *****
> > 'System.Reflection.TargetInvocationException' occurred in mscorlib.dll > >
> > Additional information: Exception has been thrown by the target of an > > invocation.
> > *****
> >
> >
> >
> > ---code----
> > ...
> > private System.Windows.Forms.ImageList ilMainFrame;
> > ...
> >
> > private void InitializeComponent()
> > {
> > ...
> > this.ilMainFrame.ImageStream =
> > ((System.Windows.Forms.ImageListStreamer) (resources.GetObject > > "ilMainFrame.ImageStream")));
> > ...
> > }
> > ...
> >
> > The resource file the line for the iMainFrame.ImageStream looks like: > >
> > name value comment > type
> > mimetype
> > ilMainFrame.ImageStream (null) (null)
> > application/x-microsoft.net.object.binary.base64
> >
> > The mime coded image is in the .resx file. The

element looks like: > >
> > <data name="ilMainFrame.ImageStream"
> > mimetype="application/x- microsoft.net.object.binary.base64"> > > <value>
> > ....
> > </value>
> > </data>
> >
> > I am running VS 2003 on windows XP pro.
> >
> > I have looked through MSDN, but no help.
> >
> >
> > If anyone has an answer please tell me, before I

have to phoneMicrosoft > > ($$$$).
> >
> >
> > Chuck
> >
> >
>
>


.

Nov 15 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Ed Sutton | last post by:
I have been searching for how to get an icon resource and load it into an ImageList. I added an *.ico file to my project and set the files "Build Action" to "Embedded Resource". Is there any easy...
2
by: Ed Sutton | last post by:
What's the trick to loading an icon from the embedded resources? Here are the steps I have taken: ------------------------- 1 - I added a file named "FOLDER01.ICO" to my solution project 2 - I...
1
by: JaguarX | last post by:
Hi, I made an application that displays a ListView that uses an Imagelist. I load the ImageList Control from a database I have no problems when the images are Icons or JPGs (including big sized...
2
by: A. Solomon | last post by:
Hi, I have a ImageList containing 4 bitmaps attached to a UserControl which acts as a Open/Close panel. This panel, upon click, switches the image in a PictureBox control to indicate the...
2
by: Minh | last post by:
Everytime I Use ImageList Control to add Image that has more than 256Bits colours and then an Exception throws at the line: this.imageList1.ImageStream =...
1
by: VBTricks.de.vu Webmaster | last post by:
Hello, I created an application (Windows Forms) with a form and an imagelist. Everything works fine under WinXP, but when I try to start the app on Win98, the following error is returned:...
2
by: Michael Maes | last post by:
Hi, We have been using ImageLists in our Projects extensively. Many forms have two ILs with nearly 900 bmp's each. They are configured: 32Bit, Fuchsia, 16x16 (and one 24x24). In VS2003 there...
4
by: Archimed | last post by:
Hi, I try to use an ImageList with a ListView but that don't work. I make a ListView in VirtualMode with LargeIcon view. I put the ImageList in the LargeImageList property. I add a bitmap...
0
by: gene kelley | last post by:
(using VS2005) I want to add an icon to TreeView nodes. 1) To a new project (VB or C#) I add a sample TreeView with some sample nodes. I add an ImageList component, and add one icon image. I...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.