Hi

I've an Application on my PocketPC Running.

Everything worked fine for weeks. Now I wanted to try some installation
things. and the program doesn't start anymore

these lines of code are producing the error

InitializeComponent();
Icon icon;
icon = new
Icon(this.GetType().Module.Assembly.GetManifestResourceStream("smartCRMPDA13.ico.remote.ico"));
try
{
// Here it Crashes! The Icon is set as embedded source and when I
// COpy the application folder to an other PPC everything works fine!

this.ImageList16px.Images.Add(icon);
}
catch(Exception oErr)
{
// The Exception only says "Exception"....
program.ShowMessageBox(oErr.Message,"Fehler",2);
}


So any hints? I've absolutly no Idea whats going wrong here....

Re: Nasty Error by Boas

Boas
Wed Nov 23 08:35:55 CST 2005

I've forgotten something to mention.

Since this error occurs the OpenNETCF(1.4) keeps reinstalling everytime I
start the app with my debugger, what it didn't since 1.4.

Re: Nasty Error - Solution by Boas

Boas
Thu Nov 24 01:36:47 CST 2005

Am Wed, 23 Nov 2005 15:35:55 +0100 schrieb Boas Enkler:
Finally I found the solution but I don't know why it worky now nor why it
has worked before....

On the Forms I've a toolbar and a imagelist.

In the designer I assign the imagelist to the toolbar.
After the initialize components method I dynamically add images to the
control and thats where it fails.

when I change the assignment in the designer to empty and then only assign
the imagelist _after_ all icons werer dynamically added then everything
works fine.

So why does it behave like this?

Re: Nasty Error - Solution by CarlPerkins

CarlPerkins
Fri Dec 02 17:13:02 CST 2005

Not sure if this is the fix but I had a problem that suddenly surfaced RIGHT
AFTER the initializecomponent() in my pda app. There is a 32k limit on the
size of the method code in .net cf. My problem occurred just after I added a
new object to my pda screen. When I cut some of the code from
initializecomponent() and created a new method, PseudoInitializeComponent(),
and pasted the code in, then called PseudoInitializeComponent() right after
the initializecomponent(), all my problems went away.

"Boas Enkler" wrote:

> Am Wed, 23 Nov 2005 15:35:55 +0100 schrieb Boas Enkler:
> Finally I found the solution but I don't know why it worky now nor why it
> has worked before....
>
> On the Forms I've a toolbar and a imagelist.
>
> In the designer I assign the imagelist to the toolbar.
> After the initialize components method I dynamically add images to the
> control and thats where it fails.
>
> when I change the assignment in the designer to empty and then only assign
> the imagelist _after_ all icons werer dynamically added then everything
> works fine.
>
> So why does it behave like this?
>

Re: Nasty Error - Solution by Dinesh

Dinesh
Sat Dec 03 03:27:55 CST 2005

I think the program behavior is perfectly logical as this rule was
place even in VB6 that once the imagelist has been assigned to a
control, then images can not be added to or removed from it.