473,395 Members | 1,541 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,395 software developers and data experts.

Hidden resource files?

The following is driving me mad:

VS2005 Compact framework, project upgraded from 2003.

I get a cast exeception error trying to populate an imagelist (code is
by design)
Me.imgListDiv.Images.Clear()

Me.imgListDiv.Images.Add(CType(resources.GetObject ("resource"),
System.Drawing.Icon))

Me.imgListDiv.Images.Add(CType(resources.GetObject ("resource1"),
System.Drawing.Icon))

When I look in the forms resources (mainform.resx) - icons the icons
are all there nicely organized, recource, resource1, etc..
There are NO 'images' in the MainForm.resx

The project builds fine but when I debug the code hangs with a:

System.InvalidCastException was unhandled
Message="InvalidCastException"
StackTrace:
bij DigiWaiterPDA.MainForm.InitializeComponent()
bij DigiWaiterPDA.MainForm..ctor()
bij System.Reflection.RuntimeConstructorInfo.InternalI nvoke()
bij System.Reflection.RuntimeConstructorInfo.Invoke()
bij System.Reflection.ConstructorInfo.Invoke()
bij System.Activator.CreateInstance()
at MyForms.Create__Instance__()
at MyForms.get_MainForm()
bij DigiWaiterPDA.MainForm.Main()

On the line:
Me.imgListDiv.Images.Add(CType(resources.GetObject ("resource"),
System.Drawing.Icon))

When I try to retrieve the resource in the immediate window:
? resources.GetObject("resource")
{System.Drawing.Bitmap}
System.Drawing.Bitmap: {System.Drawing.Bitmap}
It shows me 'resource' (and resource1) are bitmaps while they're
supposed to be icons.

If I bind the resourcefile to an existing picturebox and save it on
the PDA (emulator) I can tell a .bmp which I used earlier in the
project is shown so I thought I'd try and delete all those images with
a 'build action' embedded resource' but all with no success though ;((

The 'Localizable' property of the form is false (at the moment,
because I really want the form to be localizable thus allowing multi-
langual).
Are there resource files outside the default forms and project
resource files?

Any help is much appreciated!!!

Kind regards,

Mike

Apr 8 '07 #1
1 1779
I hate it when after searching hours and hours you find this one post
with the exact same problem just to see the question's never answered.

I didn't really find out where those unwanted, strange, hidden
resources came from.
I installed SharpDevelop to see if I could find out more with the
Resouce toolkit but that didn't change anything.
Finally I tried changing the root namespace and that seemed to do the
trick.

resources.GetObject("resource") 1, 2, 3, etc pointed to the right icon
file and not to the ghost bitmaps!

Mike

Apr 11 '07 #2

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

Similar topics

11
by: Danny Pressley | last post by:
I have a VS.NET 2003 Visual C++ MFC Application Project in which I added a new resource file, I then added an icon to this new resource file and did a rebuild and got the following error: "fatal...
1
by: Namratha Shah \(Nasha\) | last post by:
Hi All, This is a resource file generation tool which converts an xml based resource formats to .net resource file i.e. (.resources) and vice-versa. Today we will see how we will generate ...
0
by: Kleanthis | last post by:
I have a problem, when deploying multilingual applications using cab files on Compact Framework 2.0. It seems that something is going wrong with compact framework 2.0 Below I have a description...
1
by: urban.john | last post by:
Here are my steps: create resource files from resx files: <echo message="CREATING RESOURCE FILES FROM RESGEN EN" /> <resgen todir="product\resources_en" verbose="true"> <resources> <include...
1
by: Tom | last post by:
This may seem a little strange, but in all my years of developing Windows Forms apps, I've never really used Resource files; however, I would like to start doing so in order to store icons,...
7
by: craig | last post by:
....quick question for anyone who might have some experience with .net resource files in VS 2003. I have an application that is not localized, but I would still like to be able to place all of...
12
by: TS | last post by:
i have a need to possibly enable mutli language support. What benefit do i get by using a resource file instead of a custom xml solution? thanks!
0
by: VigneshS | last post by:
Hi, I am a newbie to Globalization and Localisation Concepts. I tried almost all the methods of the Globalization concepts. But i cannot be able to embed a text file within a Resource. ...
1
by: TisMe | last post by:
Hi All, I am trying to use resource files to globalize my website application. I had this working fine, working through the API for setting page titles programatically, with the resource files...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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
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
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
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...

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.