From: Mehmet AVSAR on
Hi,

I'm using Resco components for UI enhancement. When setting
Resco.ImageButton's ImageDefault property like below, I get an exception of
NullReferenceException on Bitmap.ctor(). Looking at the stack trace, inner
exception message says "value does not fall within the expected range". And
since the exception occurs on different thread, I cannot catch it.

this.ibSubeGiris.ImageVgaDefault =
((System.Drawing.Image)(resources.GetObject("ibSubeGiris.ImageVgaDefault")));

What's strange is;
- Exception only occurs on Win CE, while it works well on Win Mobile
- I can't get the exception on debug mode. It just pops out when running on
release mode.

After googling a little, I found some check points:
- Is resource namespace different than the executing assembly's namespace.
Nope.
- Is ImageName an empty string. Nope.
- The file ImageName refers to does not exist. Nope.

Since it works well on Win Mobile, I don't think it's an issue about
resources. And the inner exception message (value not in the range) makes me
think that Windows CE handles threads in a different way than Windows
Mobile, and Resco has some bug there. Resco denies.

Any idea is appreciated.

Regards,
Mehmet AVSAR

From: Paul G. Tobey [eMVP] paultobey _at_ earthlink _dot_ on
No. Windows Mobile *is* Windows CE. The shell is different and certain
settings that are flexible for Windows CE device OEMs are fixed by Microsoft
for Windows Mobile OEMs, but the operating system is the same. Threads work
the same. This is a Resco/You issue. One of you is doing something wrong.

Paul T.

"Mehmet AVSAR" wrote:

> Hi,
>
> I'm using Resco components for UI enhancement. When setting
> Resco.ImageButton's ImageDefault property like below, I get an exception of
> NullReferenceException on Bitmap.ctor(). Looking at the stack trace, inner
> exception message says "value does not fall within the expected range". And
> since the exception occurs on different thread, I cannot catch it.
>
> this.ibSubeGiris.ImageVgaDefault =
> ((System.Drawing.Image)(resources.GetObject("ibSubeGiris.ImageVgaDefault")));
>
> What's strange is;
> - Exception only occurs on Win CE, while it works well on Win Mobile
> - I can't get the exception on debug mode. It just pops out when running on
> release mode.
>
> After googling a little, I found some check points:
> - Is resource namespace different than the executing assembly's namespace.
> Nope.
> - Is ImageName an empty string. Nope.
> - The file ImageName refers to does not exist. Nope.
>
> Since it works well on Win Mobile, I don't think it's an issue about
> resources. And the inner exception message (value not in the range) makes me
> think that Windows CE handles threads in a different way than Windows
> Mobile, and Resco has some bug there. Resco denies.
>
> Any idea is appreciated.
>
> Regards,
> Mehmet AVSAR
>