Bitmap() constructor fails with C#

J

JoeB

Bitmap constructor is causing an exception and the application exits. The is
under WinCE5.0, .netCF and deployed with VS2003.


Anyone else seen and / or solved this problem?



Joe
 
J

JoeB

Not much to say really,


private static Bitmap bmSidePanelImage;

:
:

bmSidePanelImage = new Bitmap( "Sidebar.bmp" );


This crashes. I have tried with a png and it again crashes.




Joe
 
C

Chris Tacke, eMVP

ANd it crashes how....? A managed exception? Which one? An unmanaged
exception? Which one? Your device is? If it's not PPC, does it have
imgdecmp.dll? You have to give us enough info to help without playing 20
questions.

--
Chris Tacke
Co-founder
OpenNETCF.org
Are you using the SDF? Let's do a case study.
Email us at d c s @ o p e n n e t c f . c o m
http://www.opennetcf.org/donate
 
S

Sergey Bogdanov

Did you get the FileNotFoundException? Make sure that:

1. Sidebar.bmp exists in the application's directory
2. Instead of "Sidebar.bmp" use:

------------8<-------------------------------
Bitmap bmp = new Bitmap(Path.Combine(AppDir, "Sidebar.bmp"));

....

private string AppDir
{
get
{
return
Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().GetName().CodeBase);
}
}
------------8<-------------------------------
 
J

JoeB

Hi,


I dont know enough about what is happening to be able to accuratly describe
what i see, so please do ask 1000's of questions if required.

I have the PAth.Combine wtuff in there. It does indeed appear to find the
bitmap, but fails to load it.

The exception is a show stopper, the application closes afterwards.

An unexpected error has occurred in BmpTest.exe
Select Quite and then restart this program, or select Details for more
information.

<details>

Error
BmpTest.exe
Exception

Application:Run+0xf
Form1::Main+0xa


It happens at the line of code:

string sImage = GetApplicationPath() + @"SideBarImage.png";
bmSidePanelImage = new Bitmap( sImage ); // HERE





j







Sergey Bogdanov said:
Did you get the FileNotFoundException? Make sure that:

1. Sidebar.bmp exists in the application's directory
2. Instead of "Sidebar.bmp" use:

------------8<-------------------------------
Bitmap bmp = new Bitmap(Path.Combine(AppDir, "Sidebar.bmp"));

...

private string AppDir
{
get
{
return
Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().GetName().CodeBase);
}
}
------------8<-------------------------------


--
Sergey Bogdanov [.NET CF MVP, MCSD]
http://www.sergeybogdanov.com

Not much to say really,


private static Bitmap bmSidePanelImage;

:
:

bmSidePanelImage = new Bitmap( "Sidebar.bmp" );


This crashes. I have tried with a png and it again crashes.




Joe
 
C

Chris Tacke, eMVP

Again, what device is this on?

--
Chris Tacke
Co-founder
OpenNETCF.org
Are you using the SDF? Let's do a case study.
Email us at d c s @ o p e n n e t c f . c o m
http://www.opennetcf.org/donate


JoeB said:
Hi,


I dont know enough about what is happening to be able to accuratly
describe what i see, so please do ask 1000's of questions if required.

I have the PAth.Combine wtuff in there. It does indeed appear to find the
bitmap, but fails to load it.

The exception is a show stopper, the application closes afterwards.

An unexpected error has occurred in BmpTest.exe
Select Quite and then restart this program, or select Details for more
information.

<details>

Error
BmpTest.exe
Exception

Application:Run+0xf
Form1::Main+0xa


It happens at the line of code:

string sImage = GetApplicationPath() + @"SideBarImage.png";
bmSidePanelImage = new Bitmap( sImage ); // HERE





j







Sergey Bogdanov said:
Did you get the FileNotFoundException? Make sure that:

1. Sidebar.bmp exists in the application's directory
2. Instead of "Sidebar.bmp" use:

------------8<-------------------------------
Bitmap bmp = new Bitmap(Path.Combine(AppDir, "Sidebar.bmp"));

...

private string AppDir
{
get
{
return
Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().GetName().CodeBase);
}
}
------------8<-------------------------------


--
Sergey Bogdanov [.NET CF MVP, MCSD]
http://www.sergeybogdanov.com

Not much to say really,


private static Bitmap bmSidePanelImage;

:
:

bmSidePanelImage = new Bitmap( "Sidebar.bmp" );


This crashes. I have tried with a png and it again crashes.




Joe







A little bit of code might help us understand....

--
Chris Tacke
Co-founder
OpenNETCF.org
Are you using the SDF? Let's do a case study.
Email us at d c s @ o p e n n e t c f . c o m
http://www.opennetcf.org/donate



Bitmap constructor is causing an exception and the application exits.
The is under WinCE5.0, .netCF and deployed with VS2003.


Anyone else seen and / or solved this problem?



Joe
 
O

Olivier

Hello JoeB,

What is the build action for the graphic set to (under the graphic's properties)?

Cheers,
Olivier
Hi,

I dont know enough about what is happening to be able to accuratly
describe what i see, so please do ask 1000's of questions if required.

I have the PAth.Combine wtuff in there. It does indeed appear to find
the bitmap, but fails to load it.

The exception is a show stopper, the application closes afterwards.

An unexpected error has occurred in BmpTest.exe
Select Quite and then restart this program, or select Details for more
information.
<details>

Error
BmpTest.exe
Exception
Application:Run+0xf
Form1::Main+0xa
It happens at the line of code:

string sImage = GetApplicationPath() + @"SideBarImage.png";
bmSidePanelImage = new Bitmap( sImage ); // HERE

j

Did you get the FileNotFoundException? Make sure that:

1. Sidebar.bmp exists in the application's directory 2. Instead of
"Sidebar.bmp" use:

------------8<-------------------------------
Bitmap bmp = new Bitmap(Path.Combine(AppDir, "Sidebar.bmp"));
...

private string AppDir
{
get
{
return
Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly
().GetName().CodeBase);
}
}
------------8<-------------------------------
--
Sergey Bogdanov [.NET CF MVP, MCSD]
http://www.sergeybogdanov.com
JoeB said:
Not much to say really,

private static Bitmap bmSidePanelImage;

:
:
bmSidePanelImage = new Bitmap( "Sidebar.bmp" );

This crashes. I have tried with a png and it again crashes.

Joe


A little bit of code might help us understand....

--
Chris Tacke
Co-founder
OpenNETCF.org
Are you using the SDF? Let's do a case study.
Email us at d c s @ o p e n n e t c f . c o m
http://www.opennetcf.org/donate

Bitmap constructor is causing an exception and the application
exits. The is under WinCE5.0, .netCF and deployed with VS2003.

Anyone else seen and / or solved this problem?

Joe
 
J

JoeB

WinCe5.0, .netCF 1.0.4292.00





Chris Tacke said:
Again, what device is this on?

--
Chris Tacke
Co-founder
OpenNETCF.org
Are you using the SDF? Let's do a case study.
Email us at d c s @ o p e n n e t c f . c o m
http://www.opennetcf.org/donate


JoeB said:
Hi,


I dont know enough about what is happening to be able to accuratly
describe what i see, so please do ask 1000's of questions if required.

I have the PAth.Combine wtuff in there. It does indeed appear to find the
bitmap, but fails to load it.

The exception is a show stopper, the application closes afterwards.

An unexpected error has occurred in BmpTest.exe
Select Quite and then restart this program, or select Details for more
information.

<details>

Error
BmpTest.exe
Exception

Application:Run+0xf
Form1::Main+0xa


It happens at the line of code:

string sImage = GetApplicationPath() + @"SideBarImage.png";
bmSidePanelImage = new Bitmap( sImage ); // HERE





j







Sergey Bogdanov said:
Did you get the FileNotFoundException? Make sure that:

1. Sidebar.bmp exists in the application's directory
2. Instead of "Sidebar.bmp" use:

------------8<-------------------------------
Bitmap bmp = new Bitmap(Path.Combine(AppDir, "Sidebar.bmp"));

...

private string AppDir
{
get
{
return
Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().GetName().CodeBase);
}
}
------------8<-------------------------------


--
Sergey Bogdanov [.NET CF MVP, MCSD]
http://www.sergeybogdanov.com


JoeB wrote:
Not much to say really,


private static Bitmap bmSidePanelImage;

:
:

bmSidePanelImage = new Bitmap( "Sidebar.bmp" );


This crashes. I have tried with a png and it again crashes.




Joe







A little bit of code might help us understand....

--
Chris Tacke
Co-founder
OpenNETCF.org
Are you using the SDF? Let's do a case study.
Email us at d c s @ o p e n n e t c f . c o m
http://www.opennetcf.org/donate



Bitmap constructor is causing an exception and the application exits.
The is under WinCE5.0, .netCF and deployed with VS2003.


Anyone else seen and / or solved this problem?



Joe
 
J

JoeB

Content.

The image is on the device.




j


Olivier said:
Hello JoeB,

What is the build action for the graphic set to (under the graphic's
properties)?

Cheers,
Olivier
Hi,

I dont know enough about what is happening to be able to accuratly
describe what i see, so please do ask 1000's of questions if required.

I have the PAth.Combine wtuff in there. It does indeed appear to find
the bitmap, but fails to load it.

The exception is a show stopper, the application closes afterwards.

An unexpected error has occurred in BmpTest.exe
Select Quite and then restart this program, or select Details for more
information.
<details>

Error
BmpTest.exe
Exception
Application:Run+0xf
Form1::Main+0xa
It happens at the line of code:

string sImage = GetApplicationPath() + @"SideBarImage.png";
bmSidePanelImage = new Bitmap( sImage ); // HERE

j

Did you get the FileNotFoundException? Make sure that:

1. Sidebar.bmp exists in the application's directory 2. Instead of
"Sidebar.bmp" use:

------------8<-------------------------------
Bitmap bmp = new Bitmap(Path.Combine(AppDir, "Sidebar.bmp"));
...

private string AppDir
{
get
{
return
Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly
().GetName().CodeBase);
}
}
------------8<-------------------------------
--
Sergey Bogdanov [.NET CF MVP, MCSD]
http://www.sergeybogdanov.com
JoeB wrote:

Not much to say really,

private static Bitmap bmSidePanelImage;

:
:
bmSidePanelImage = new Bitmap( "Sidebar.bmp" );

This crashes. I have tried with a png and it again crashes.

Joe


A little bit of code might help us understand....

--
Chris Tacke
Co-founder
OpenNETCF.org
Are you using the SDF? Let's do a case study.
Email us at d c s @ o p e n n e t c f . c o m
http://www.opennetcf.org/donate

Bitmap constructor is causing an exception and the application
exits. The is under WinCE5.0, .netCF and deployed with VS2003.

Anyone else seen and / or solved this problem?

Joe
 
C

Chris Tacke, eMVP

Ahhh, so now we're getting somewhere. My bet is your image doesn't have the
proper imaging DLL, so the underlying classes are not able to load them. In
4.2 it was imgdecmp.dll, which loads with PIE or through manual BIB editing
(it's not directly in the catalog). Add PIE to your platform and see if it
works - if it does, then you'll have to do some work to just get the imaging
library into your build (assuming you don't want PIE of course).

--
Chris Tacke
Co-founder
OpenNETCF.org
Are you using the SDF? Let's do a case study.
Email us at d c s @ o p e n n e t c f . c o m
http://www.opennetcf.org/donate


JoeB said:
WinCe5.0, .netCF 1.0.4292.00





Chris Tacke said:
Again, what device is this on?

--
Chris Tacke
Co-founder
OpenNETCF.org
Are you using the SDF? Let's do a case study.
Email us at d c s @ o p e n n e t c f . c o m
http://www.opennetcf.org/donate


JoeB said:
Hi,


I dont know enough about what is happening to be able to accuratly
describe what i see, so please do ask 1000's of questions if required.

I have the PAth.Combine wtuff in there. It does indeed appear to find
the bitmap, but fails to load it.

The exception is a show stopper, the application closes afterwards.

An unexpected error has occurred in BmpTest.exe
Select Quite and then restart this program, or select Details for more
information.

<details>

Error
BmpTest.exe
Exception

Application:Run+0xf
Form1::Main+0xa


It happens at the line of code:

string sImage = GetApplicationPath() + @"SideBarImage.png";
bmSidePanelImage = new Bitmap( sImage ); // HERE





j







Did you get the FileNotFoundException? Make sure that:

1. Sidebar.bmp exists in the application's directory
2. Instead of "Sidebar.bmp" use:

------------8<-------------------------------
Bitmap bmp = new Bitmap(Path.Combine(AppDir, "Sidebar.bmp"));

...

private string AppDir
{
get
{
return
Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().GetName().CodeBase);
}
}
------------8<-------------------------------


--
Sergey Bogdanov [.NET CF MVP, MCSD]
http://www.sergeybogdanov.com


JoeB wrote:
Not much to say really,


private static Bitmap bmSidePanelImage;

:
:

bmSidePanelImage = new Bitmap( "Sidebar.bmp" );


This crashes. I have tried with a png and it again crashes.




Joe







A little bit of code might help us understand....

--
Chris Tacke
Co-founder
OpenNETCF.org
Are you using the SDF? Let's do a case study.
Email us at d c s @ o p e n n e t c f . c o m
http://www.opennetcf.org/donate



Bitmap constructor is causing an exception and the application exits.
The is under WinCE5.0, .netCF and deployed with VS2003.


Anyone else seen and / or solved this problem?



Joe
 
J

JoeB

PIE is already included in the image. The bitmaps used to load, then one
day (without a change to the image) they stopped working.

My best guess is visual studio is currupting the device some how during
deploy. Once the device has been currupted, it never recovers. We have
several devices, all with the same bin file installed, and some work, some
dont - very strange.






j



Chris Tacke said:
Ahhh, so now we're getting somewhere. My bet is your image doesn't have
the proper imaging DLL, so the underlying classes are not able to load
them. In 4.2 it was imgdecmp.dll, which loads with PIE or through manual
BIB editing (it's not directly in the catalog). Add PIE to your platform
and see if it works - if it does, then you'll have to do some work to just
get the imaging library into your build (assuming you don't want PIE of
course).

--
Chris Tacke
Co-founder
OpenNETCF.org
Are you using the SDF? Let's do a case study.
Email us at d c s @ o p e n n e t c f . c o m
http://www.opennetcf.org/donate


JoeB said:
WinCe5.0, .netCF 1.0.4292.00





Chris Tacke said:
Again, what device is this on?

--
Chris Tacke
Co-founder
OpenNETCF.org
Are you using the SDF? Let's do a case study.
Email us at d c s @ o p e n n e t c f . c o m
http://www.opennetcf.org/donate


Hi,


I dont know enough about what is happening to be able to accuratly
describe what i see, so please do ask 1000's of questions if required.

I have the PAth.Combine wtuff in there. It does indeed appear to find
the bitmap, but fails to load it.

The exception is a show stopper, the application closes afterwards.

An unexpected error has occurred in BmpTest.exe
Select Quite and then restart this program, or select Details for more
information.

<details>

Error
BmpTest.exe
Exception

Application:Run+0xf
Form1::Main+0xa


It happens at the line of code:

string sImage = GetApplicationPath() + @"SideBarImage.png";
bmSidePanelImage = new Bitmap( sImage ); // HERE





j







Did you get the FileNotFoundException? Make sure that:

1. Sidebar.bmp exists in the application's directory
2. Instead of "Sidebar.bmp" use:

------------8<-------------------------------
Bitmap bmp = new Bitmap(Path.Combine(AppDir, "Sidebar.bmp"));

...

private string AppDir
{
get
{
return
Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().GetName().CodeBase);
}
}
------------8<-------------------------------


--
Sergey Bogdanov [.NET CF MVP, MCSD]
http://www.sergeybogdanov.com


JoeB wrote:
Not much to say really,


private static Bitmap bmSidePanelImage;

:
:

bmSidePanelImage = new Bitmap( "Sidebar.bmp" );


This crashes. I have tried with a png and it again crashes.




Joe







A little bit of code might help us understand....

--
Chris Tacke
Co-founder
OpenNETCF.org
Are you using the SDF? Let's do a case study.
Email us at d c s @ o p e n n e t c f . c o m
http://www.opennetcf.org/donate



Bitmap constructor is causing an exception and the application
exits. The is under WinCE5.0, .netCF and deployed with VS2003.


Anyone else seen and / or solved this problem?



Joe
 
G

Guest

So if you push the app to the device without Studio (a storage card, USB,
ActiveSyc, etc.) and run it does it fail?

-Chris


JoeB said:
PIE is already included in the image. The bitmaps used to load, then one
day (without a change to the image) they stopped working.

My best guess is visual studio is currupting the device some how during
deploy. Once the device has been currupted, it never recovers. We have
several devices, all with the same bin file installed, and some work, some
dont - very strange.






j



Chris Tacke said:
Ahhh, so now we're getting somewhere. My bet is your image doesn't have
the proper imaging DLL, so the underlying classes are not able to load
them. In 4.2 it was imgdecmp.dll, which loads with PIE or through manual
BIB editing (it's not directly in the catalog). Add PIE to your platform
and see if it works - if it does, then you'll have to do some work to
just get the imaging library into your build (assuming you don't want PIE
of course).

--
Chris Tacke
Co-founder
OpenNETCF.org
Are you using the SDF? Let's do a case study.
Email us at d c s @ o p e n n e t c f . c o m
http://www.opennetcf.org/donate


JoeB said:
WinCe5.0, .netCF 1.0.4292.00





Again, what device is this on?

--
Chris Tacke
Co-founder
OpenNETCF.org
Are you using the SDF? Let's do a case study.
Email us at d c s @ o p e n n e t c f . c o m
http://www.opennetcf.org/donate


Hi,


I dont know enough about what is happening to be able to accuratly
describe what i see, so please do ask 1000's of questions if required.

I have the PAth.Combine wtuff in there. It does indeed appear to find
the bitmap, but fails to load it.

The exception is a show stopper, the application closes afterwards.

An unexpected error has occurred in BmpTest.exe
Select Quite and then restart this program, or select Details for more
information.

<details>

Error
BmpTest.exe
Exception

Application:Run+0xf
Form1::Main+0xa


It happens at the line of code:

string sImage = GetApplicationPath() + @"SideBarImage.png";
bmSidePanelImage = new Bitmap( sImage ); // HERE





j







Did you get the FileNotFoundException? Make sure that:

1. Sidebar.bmp exists in the application's directory
2. Instead of "Sidebar.bmp" use:

------------8<-------------------------------
Bitmap bmp = new Bitmap(Path.Combine(AppDir, "Sidebar.bmp"));

...

private string AppDir
{
get
{
return
Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().GetName().CodeBase);
}
}
------------8<-------------------------------


--
Sergey Bogdanov [.NET CF MVP, MCSD]
http://www.sergeybogdanov.com


JoeB wrote:
Not much to say really,


private static Bitmap bmSidePanelImage;

:
:

bmSidePanelImage = new Bitmap( "Sidebar.bmp" );


This crashes. I have tried with a png and it again crashes.




Joe







A little bit of code might help us understand....

--
Chris Tacke
Co-founder
OpenNETCF.org
Are you using the SDF? Let's do a case study.
Email us at d c s @ o p e n n e t c f . c o m
http://www.opennetcf.org/donate



Bitmap constructor is causing an exception and the application
exits. The is under WinCE5.0, .netCF and deployed with VS2003.


Anyone else seen and / or solved this problem?



Joe
 
J

JoeB

Hi


Been doing some tests on this issue over the last few days... If i take a
brand new device out of the box, never programmed, and put a platform image
on to it, then load my software to the device via platform builder file
viewer, then completly disconnect from the device, and run my app it runs as
expected.


Now i can restart the device, whatever.. the program always runs.

If i deploy from visual studio to the device and install the cab files it
wants me to install, and deploy anything at all, not necessary the program
in question, i can never run another application on the device. Ever, no
matter what i do. - reload the platform bin file, delete the registy, nope,
neither allow the software to run again.


If i flash the NAND storage on the device back to factory setup, and reload
the platform bin file, and my program it runs again.

Deploying from visual studio is perminantly breaking somthing that causes my
app to fail, and only by reformatting the nand and reloading the platform
bin file can i get it to work again.



j



So if you push the app to the device without Studio (a storage card, USB,
ActiveSyc, etc.) and run it does it fail?

-Chris


JoeB said:
PIE is already included in the image. The bitmaps used to load, then one
day (without a change to the image) they stopped working.

My best guess is visual studio is currupting the device some how during
deploy. Once the device has been currupted, it never recovers. We have
several devices, all with the same bin file installed, and some work,
some dont - very strange.






j



Chris Tacke said:
Ahhh, so now we're getting somewhere. My bet is your image doesn't have
the proper imaging DLL, so the underlying classes are not able to load
them. In 4.2 it was imgdecmp.dll, which loads with PIE or through
manual BIB editing (it's not directly in the catalog). Add PIE to your
platform and see if it works - if it does, then you'll have to do some
work to just get the imaging library into your build (assuming you don't
want PIE of course).

--
Chris Tacke
Co-founder
OpenNETCF.org
Are you using the SDF? Let's do a case study.
Email us at d c s @ o p e n n e t c f . c o m
http://www.opennetcf.org/donate


WinCe5.0, .netCF 1.0.4292.00





Again, what device is this on?

--
Chris Tacke
Co-founder
OpenNETCF.org
Are you using the SDF? Let's do a case study.
Email us at d c s @ o p e n n e t c f . c o m
http://www.opennetcf.org/donate


Hi,


I dont know enough about what is happening to be able to accuratly
describe what i see, so please do ask 1000's of questions if
required.

I have the PAth.Combine wtuff in there. It does indeed appear to find
the bitmap, but fails to load it.

The exception is a show stopper, the application closes afterwards.

An unexpected error has occurred in BmpTest.exe
Select Quite and then restart this program, or select Details for
more information.

<details>

Error
BmpTest.exe
Exception

Application:Run+0xf
Form1::Main+0xa


It happens at the line of code:

string sImage = GetApplicationPath() + @"SideBarImage.png";
bmSidePanelImage = new Bitmap( sImage ); // HERE





j







Did you get the FileNotFoundException? Make sure that:

1. Sidebar.bmp exists in the application's directory
2. Instead of "Sidebar.bmp" use:

------------8<-------------------------------
Bitmap bmp = new Bitmap(Path.Combine(AppDir, "Sidebar.bmp"));

...

private string AppDir
{
get
{
return
Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().GetName().CodeBase);
}
}
------------8<-------------------------------


--
Sergey Bogdanov [.NET CF MVP, MCSD]
http://www.sergeybogdanov.com


JoeB wrote:
Not much to say really,


private static Bitmap bmSidePanelImage;

:
:

bmSidePanelImage = new Bitmap( "Sidebar.bmp" );


This crashes. I have tried with a png and it again crashes.




Joe






message
A little bit of code might help us understand....

--
Chris Tacke
Co-founder
OpenNETCF.org
Are you using the SDF? Let's do a case study.
Email us at d c s @ o p e n n e t c f . c o m
http://www.opennetcf.org/donate



Bitmap constructor is causing an exception and the application
exits. The is under WinCE5.0, .netCF and deployed with VS2003.


Anyone else seen and / or solved this problem?



Joe
 
C

Chris Tacke, eMVP

Yep, I can verify that it occurs on any system with a persistent registry
and is the cause for many a support call. Take a look at my blog entry:

http://blog.opennetcf.org/ctacke/PermaLink,guid,69a37b32-4448-4ea4-bd2b-9aa6fb3374f7.aspx

--
Chris Tacke
Co-founder
OpenNETCF.org
Are you using the SDF? Let's do a case study.
Email us at d c s @ o p e n n e t c f . c o m
http://www.opennetcf.org/donate


JoeB said:
Hi


Been doing some tests on this issue over the last few days... If i take a
brand new device out of the box, never programmed, and put a platform
image on to it, then load my software to the device via platform builder
file viewer, then completly disconnect from the device, and run my app it
runs as expected.


Now i can restart the device, whatever.. the program always runs.

If i deploy from visual studio to the device and install the cab files it
wants me to install, and deploy anything at all, not necessary the program
in question, i can never run another application on the device. Ever, no
matter what i do. - reload the platform bin file, delete the registy,
nope, neither allow the software to run again.


If i flash the NAND storage on the device back to factory setup, and
reload the platform bin file, and my program it runs again.

Deploying from visual studio is perminantly breaking somthing that causes
my app to fail, and only by reformatting the nand and reloading the
platform bin file can i get it to work again.



j



So if you push the app to the device without Studio (a storage card, USB,
ActiveSyc, etc.) and run it does it fail?

-Chris


JoeB said:
PIE is already included in the image. The bitmaps used to load, then
one day (without a change to the image) they stopped working.

My best guess is visual studio is currupting the device some how during
deploy. Once the device has been currupted, it never recovers. We have
several devices, all with the same bin file installed, and some work,
some dont - very strange.






j



Ahhh, so now we're getting somewhere. My bet is your image doesn't
have the proper imaging DLL, so the underlying classes are not able to
load them. In 4.2 it was imgdecmp.dll, which loads with PIE or through
manual BIB editing (it's not directly in the catalog). Add PIE to your
platform and see if it works - if it does, then you'll have to do some
work to just get the imaging library into your build (assuming you
don't want PIE of course).

--
Chris Tacke
Co-founder
OpenNETCF.org
Are you using the SDF? Let's do a case study.
Email us at d c s @ o p e n n e t c f . c o m
http://www.opennetcf.org/donate


WinCe5.0, .netCF 1.0.4292.00





Again, what device is this on?

--
Chris Tacke
Co-founder
OpenNETCF.org
Are you using the SDF? Let's do a case study.
Email us at d c s @ o p e n n e t c f . c o m
http://www.opennetcf.org/donate


Hi,


I dont know enough about what is happening to be able to accuratly
describe what i see, so please do ask 1000's of questions if
required.

I have the PAth.Combine wtuff in there. It does indeed appear to
find the bitmap, but fails to load it.

The exception is a show stopper, the application closes afterwards.

An unexpected error has occurred in BmpTest.exe
Select Quite and then restart this program, or select Details for
more information.

<details>

Error
BmpTest.exe
Exception

Application:Run+0xf
Form1::Main+0xa


It happens at the line of code:

string sImage = GetApplicationPath() + @"SideBarImage.png";
bmSidePanelImage = new Bitmap( sImage ); // HERE





j







Did you get the FileNotFoundException? Make sure that:

1. Sidebar.bmp exists in the application's directory
2. Instead of "Sidebar.bmp" use:

------------8<-------------------------------
Bitmap bmp = new Bitmap(Path.Combine(AppDir, "Sidebar.bmp"));

...

private string AppDir
{
get
{
return
Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().GetName().CodeBase);
}
}
------------8<-------------------------------


--
Sergey Bogdanov [.NET CF MVP, MCSD]
http://www.sergeybogdanov.com


JoeB wrote:
Not much to say really,


private static Bitmap bmSidePanelImage;

:
:

bmSidePanelImage = new Bitmap( "Sidebar.bmp" );


This crashes. I have tried with a png and it again crashes.




Joe






message
A little bit of code might help us understand....

--
Chris Tacke
Co-founder
OpenNETCF.org
Are you using the SDF? Let's do a case study.
Email us at d c s @ o p e n n e t c f . c o m
http://www.opennetcf.org/donate



Bitmap constructor is causing an exception and the application
exits. The is under WinCE5.0, .netCF and deployed with VS2003.


Anyone else seen and / or solved this problem?



Joe
 
J

JoeB

Hi



I ran DelCryptoKey for my processor (ARMV4I), and then tried to execute my
application and again, i get the same issue.



JOE




Chris Tacke said:
Yep, I can verify that it occurs on any system with a persistent registry
and is the cause for many a support call. Take a look at my blog entry:

http://blog.opennetcf.org/ctacke/PermaLink,guid,69a37b32-4448-4ea4-bd2b-9aa6fb3374f7.aspx

--
Chris Tacke
Co-founder
OpenNETCF.org
Are you using the SDF? Let's do a case study.
Email us at d c s @ o p e n n e t c f . c o m
http://www.opennetcf.org/donate


JoeB said:
Hi


Been doing some tests on this issue over the last few days... If i take a
brand new device out of the box, never programmed, and put a platform
image on to it, then load my software to the device via platform builder
file viewer, then completly disconnect from the device, and run my app it
runs as expected.


Now i can restart the device, whatever.. the program always runs.

If i deploy from visual studio to the device and install the cab files it
wants me to install, and deploy anything at all, not necessary the
program in question, i can never run another application on the device.
Ever, no matter what i do. - reload the platform bin file, delete the
registy, nope, neither allow the software to run again.


If i flash the NAND storage on the device back to factory setup, and
reload the platform bin file, and my program it runs again.

Deploying from visual studio is perminantly breaking somthing that causes
my app to fail, and only by reformatting the nand and reloading the
platform bin file can i get it to work again.



j



So if you push the app to the device without Studio (a storage card,
USB, ActiveSyc, etc.) and run it does it fail?

-Chris


PIE is already included in the image. The bitmaps used to load, then
one day (without a change to the image) they stopped working.

My best guess is visual studio is currupting the device some how during
deploy. Once the device has been currupted, it never recovers. We have
several devices, all with the same bin file installed, and some work,
some dont - very strange.






j



Ahhh, so now we're getting somewhere. My bet is your image doesn't
have the proper imaging DLL, so the underlying classes are not able to
load them. In 4.2 it was imgdecmp.dll, which loads with PIE or
through manual BIB editing (it's not directly in the catalog). Add
PIE to your platform and see if it works - if it does, then you'll
have to do some work to just get the imaging library into your build
(assuming you don't want PIE of course).

--
Chris Tacke
Co-founder
OpenNETCF.org
Are you using the SDF? Let's do a case study.
Email us at d c s @ o p e n n e t c f . c o m
http://www.opennetcf.org/donate


WinCe5.0, .netCF 1.0.4292.00





Again, what device is this on?

--
Chris Tacke
Co-founder
OpenNETCF.org
Are you using the SDF? Let's do a case study.
Email us at d c s @ o p e n n e t c f . c o m
http://www.opennetcf.org/donate


Hi,


I dont know enough about what is happening to be able to accuratly
describe what i see, so please do ask 1000's of questions if
required.

I have the PAth.Combine wtuff in there. It does indeed appear to
find the bitmap, but fails to load it.

The exception is a show stopper, the application closes afterwards.

An unexpected error has occurred in BmpTest.exe
Select Quite and then restart this program, or select Details for
more information.

<details>

Error
BmpTest.exe
Exception

Application:Run+0xf
Form1::Main+0xa


It happens at the line of code:

string sImage = GetApplicationPath() + @"SideBarImage.png";
bmSidePanelImage = new Bitmap( sImage ); // HERE





j







Did you get the FileNotFoundException? Make sure that:

1. Sidebar.bmp exists in the application's directory
2. Instead of "Sidebar.bmp" use:

------------8<-------------------------------
Bitmap bmp = new Bitmap(Path.Combine(AppDir, "Sidebar.bmp"));

...

private string AppDir
{
get
{
return
Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().GetName().CodeBase);
}
}
------------8<-------------------------------


--
Sergey Bogdanov [.NET CF MVP, MCSD]
http://www.sergeybogdanov.com


JoeB wrote:
Not much to say really,


private static Bitmap bmSidePanelImage;

:
:

bmSidePanelImage = new Bitmap( "Sidebar.bmp" );


This crashes. I have tried with a png and it again crashes.




Joe






message
A little bit of code might help us understand....

--
Chris Tacke
Co-founder
OpenNETCF.org
Are you using the SDF? Let's do a case study.
Email us at d c s @ o p e n n e t c f . c o m
http://www.opennetcf.org/donate



Bitmap constructor is causing an exception and the application
exits. The is under WinCE5.0, .netCF and deployed with VS2003.


Anyone else seen and / or solved this problem?



Joe
 
G

Guest

Odd. Once I added that call our support calls dropped on this issue. Pull
a copy of the registry before depl;oy, after deplo and after running
delcryptokeys and check the differences. It's got to be in there.

-Chris


JoeB said:
Hi



I ran DelCryptoKey for my processor (ARMV4I), and then tried to execute my
application and again, i get the same issue.



JOE




Chris Tacke said:
Yep, I can verify that it occurs on any system with a persistent registry
and is the cause for many a support call. Take a look at my blog entry:

http://blog.opennetcf.org/ctacke/PermaLink,guid,69a37b32-4448-4ea4-bd2b-9aa6fb3374f7.aspx

--
Chris Tacke
Co-founder
OpenNETCF.org
Are you using the SDF? Let's do a case study.
Email us at d c s @ o p e n n e t c f . c o m
http://www.opennetcf.org/donate


JoeB said:
Hi


Been doing some tests on this issue over the last few days... If i take
a brand new device out of the box, never programmed, and put a platform
image on to it, then load my software to the device via platform builder
file viewer, then completly disconnect from the device, and run my app
it runs as expected.


Now i can restart the device, whatever.. the program always runs.

If i deploy from visual studio to the device and install the cab files
it wants me to install, and deploy anything at all, not necessary the
program in question, i can never run another application on the device.
Ever, no matter what i do. - reload the platform bin file, delete the
registy, nope, neither allow the software to run again.


If i flash the NAND storage on the device back to factory setup, and
reload the platform bin file, and my program it runs again.

Deploying from visual studio is perminantly breaking somthing that
causes my app to fail, and only by reformatting the nand and reloading
the platform bin file can i get it to work again.



j



"<ctacke/>" <ctacke_AT_OpenNETCF_com> wrote in message
So if you push the app to the device without Studio (a storage card,
USB, ActiveSyc, etc.) and run it does it fail?

-Chris


PIE is already included in the image. The bitmaps used to load, then
one day (without a change to the image) they stopped working.

My best guess is visual studio is currupting the device some how
during deploy. Once the device has been currupted, it never recovers.
We have several devices, all with the same bin file installed, and
some work, some dont - very strange.






j



Ahhh, so now we're getting somewhere. My bet is your image doesn't
have the proper imaging DLL, so the underlying classes are not able
to load them. In 4.2 it was imgdecmp.dll, which loads with PIE or
through manual BIB editing (it's not directly in the catalog). Add
PIE to your platform and see if it works - if it does, then you'll
have to do some work to just get the imaging library into your build
(assuming you don't want PIE of course).

--
Chris Tacke
Co-founder
OpenNETCF.org
Are you using the SDF? Let's do a case study.
Email us at d c s @ o p e n n e t c f . c o m
http://www.opennetcf.org/donate


WinCe5.0, .netCF 1.0.4292.00





Again, what device is this on?

--
Chris Tacke
Co-founder
OpenNETCF.org
Are you using the SDF? Let's do a case study.
Email us at d c s @ o p e n n e t c f . c o m
http://www.opennetcf.org/donate


Hi,


I dont know enough about what is happening to be able to accuratly
describe what i see, so please do ask 1000's of questions if
required.

I have the PAth.Combine wtuff in there. It does indeed appear to
find the bitmap, but fails to load it.

The exception is a show stopper, the application closes
afterwards.

An unexpected error has occurred in BmpTest.exe
Select Quite and then restart this program, or select Details for
more information.

<details>

Error
BmpTest.exe
Exception

Application:Run+0xf
Form1::Main+0xa


It happens at the line of code:

string sImage = GetApplicationPath() + @"SideBarImage.png";
bmSidePanelImage = new Bitmap( sImage ); // HERE





j







Did you get the FileNotFoundException? Make sure that:

1. Sidebar.bmp exists in the application's directory
2. Instead of "Sidebar.bmp" use:

------------8<-------------------------------
Bitmap bmp = new Bitmap(Path.Combine(AppDir, "Sidebar.bmp"));

...

private string AppDir
{
get
{
return
Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().GetName().CodeBase);
}
}
------------8<-------------------------------


--
Sergey Bogdanov [.NET CF MVP, MCSD]
http://www.sergeybogdanov.com


JoeB wrote:
Not much to say really,


private static Bitmap bmSidePanelImage;

:
:

bmSidePanelImage = new Bitmap( "Sidebar.bmp" );


This crashes. I have tried with a png and it again crashes.




Joe






message
A little bit of code might help us understand....

--
Chris Tacke
Co-founder
OpenNETCF.org
Are you using the SDF? Let's do a case study.
Email us at d c s @ o p e n n e t c f . c o m
http://www.opennetcf.org/donate



Bitmap constructor is causing an exception and the application
exits. The is under WinCE5.0, .netCF and deployed with VS2003.


Anyone else seen and / or solved this problem?



Joe
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top