PC Review Forums Newsgroups Microsoft DotNet Microsoft Dot NET Compact Framework Application gone after power on

Reply

Application gone after power on

 
Thread Tools Rate Thread
Old 16-04-2008, 03:23 PM   #1
ataha
Guest
 
Posts: n/a
Default Application gone after power on


I'm having a strange and almost undebuggable program. During my
development, my PDA (a Socket SoMo, and previously an HP) is generally
sitting in the cradle and it's powered through the night, so when I
come back in the morning the application is still running and
everything is fine.

However, our sales people take out the PDAs now and the product is
beginning to sell. Customers and salesfolk are finding that
occasionally (once every 50 times or so) when the PDA is powered down,
they power it up and find that the application is just not there. No
exception or anything. It's just gone. Since the application disables
the taskbar and it starts up automatically, this generally means they
are sitting at the today screen and can't do anything. As a temporary
fix, I will write a secondary application that keeps checking every 5
seconds (or on power up) that the primary application is running and
restarts it if it isn't.. but does anyone know how I can try to track
this problem, or if it has been seen before.

Any help would be appreciated.
Taha
  Reply With Quote
Old 16-04-2008, 04:16 PM   #2
dbgrick
Guest
 
Posts: n/a
Default RE: Application gone after power on

Try adding logging to the application. Persist any shut down or exceptions
to file. Make sure you write the stack strace for exceptions, then when you
experience this issue, you should be able to track it down.

Regards,
Rick D.

"ataha" wrote:

> I'm having a strange and almost undebuggable program. During my
> development, my PDA (a Socket SoMo, and previously an HP) is generally
> sitting in the cradle and it's powered through the night, so when I
> come back in the morning the application is still running and
> everything is fine.
>
> However, our sales people take out the PDAs now and the product is
> beginning to sell. Customers and salesfolk are finding that
> occasionally (once every 50 times or so) when the PDA is powered down,
> they power it up and find that the application is just not there. No
> exception or anything. It's just gone. Since the application disables
> the taskbar and it starts up automatically, this generally means they
> are sitting at the today screen and can't do anything. As a temporary
> fix, I will write a secondary application that keeps checking every 5
> seconds (or on power up) that the primary application is running and
> restarts it if it isn't.. but does anyone know how I can try to track
> this problem, or if it has been seen before.
>
> Any help would be appreciated.
> Taha
>

  Reply With Quote
Old 16-04-2008, 04:16 PM   #3
Paul G. Tobey [eMVP]
Guest
 
Posts: n/a
Default Re: Application gone after power on

Where is the EXE stored? I don't know anything about those particular
devices, but, if you're storing the application in the RAM filesystem, of
course, if the battery dies, it's gone. That would be my first guess. You
might also check, perhaps by writing some values to the registry, whether
the registry is also going away at the same time.

Paul T.

"ataha" <ataha13@gmail.com> wrote in message
news:c084a952-17fc-4f38-8d22-0a77a082ed0d@8g2000hsu.googlegroups.com...
> I'm having a strange and almost undebuggable program. During my
> development, my PDA (a Socket SoMo, and previously an HP) is generally
> sitting in the cradle and it's powered through the night, so when I
> come back in the morning the application is still running and
> everything is fine.
>
> However, our sales people take out the PDAs now and the product is
> beginning to sell. Customers and salesfolk are finding that
> occasionally (once every 50 times or so) when the PDA is powered down,
> they power it up and find that the application is just not there. No
> exception or anything. It's just gone. Since the application disables
> the taskbar and it starts up automatically, this generally means they
> are sitting at the today screen and can't do anything. As a temporary
> fix, I will write a secondary application that keeps checking every 5
> seconds (or on power up) that the primary application is running and
> restarts it if it isn't.. but does anyone know how I can try to track
> this problem, or if it has been seen before.
>
> Any help would be appreciated.
> Taha



  Reply With Quote
Old 17-04-2008, 04:18 AM   #4
Simon Hart [MVP]
Guest
 
Posts: n/a
Default RE: Application gone after power on

I have seen this on older devices (older Windows Mobile devices). Not sure
why the OS seems to change the Z order, this is probebly a bug or an
application on the device causing it. You'll probebly find it is still
running but just hidden, is this the case? and what ver of Windows Mobile do
you have. You've put the device model but I can't be arsed to look it up to
find out what version it is.
--
Simon Hart
Visual Developer - Device Application Development MVP
http://simonrhart.blogspot.com


"ataha" wrote:

> I'm having a strange and almost undebuggable program. During my
> development, my PDA (a Socket SoMo, and previously an HP) is generally
> sitting in the cradle and it's powered through the night, so when I
> come back in the morning the application is still running and
> everything is fine.
>
> However, our sales people take out the PDAs now and the product is
> beginning to sell. Customers and salesfolk are finding that
> occasionally (once every 50 times or so) when the PDA is powered down,
> they power it up and find that the application is just not there. No
> exception or anything. It's just gone. Since the application disables
> the taskbar and it starts up automatically, this generally means they
> are sitting at the today screen and can't do anything. As a temporary
> fix, I will write a secondary application that keeps checking every 5
> seconds (or on power up) that the primary application is running and
> restarts it if it isn't.. but does anyone know how I can try to track
> this problem, or if it has been seen before.
>
> Any help would be appreciated.
> Taha
>

  Reply With Quote
Old 17-04-2008, 04:35 AM   #5
ataha
Guest
 
Posts: n/a
Default Re: Application gone after power on

On Apr 16, 11:16 am, "Paul G. Tobey [eMVP]" <p space tobey no spam AT
no instrument no spam DOT com> wrote:
> Where is the EXE stored? I don't know anything about those particular
> devices, but, if you're storing the application in the RAM filesystem, of
> course, if the battery dies, it's gone. That would be my first guess. You
> might also check, perhaps by writing some values to the registry, whether
> the registry is also going away at the same time.
>
> Paul T.
>
> "ataha" <atah...@gmail.com> wrote in message
>
> news:c084a952-17fc-4f38-8d22-0a77a082ed0d@8g2000hsu.googlegroups.com...
>
> > I'm having a strange and almost undebuggable program. During my
> > development, my PDA (a Socket SoMo, and previously an HP) is generally
> > sitting in the cradle and it's powered through the night, so when I
> > come back in the morning the application is still running and
> > everything is fine.

>
> > However, our sales people take out the PDAs now and the product is
> > beginning to sell. Customers and salesfolk are finding that
> > occasionally (once every 50 times or so) when the PDA is powered down,
> > they power it up and find that the application is just not there. No
> > exception or anything. It's just gone. Since the application disables
> > the taskbar and it starts up automatically, this generally means they
> > are sitting at the today screen and can't do anything. As a temporary
> > fix, I will write a secondary application that keeps checking every 5
> > seconds (or on power up) that the primary application is running and
> > restarts it if it isn't.. but does anyone know how I can try to track
> > this problem, or if it has been seen before.

>
> > Any help would be appreciated.
> > Taha


Paul: I don't mean a total power drainage of the device, I mean just a
simple power off, power on, sometimes with a few days in between. Does
the ability of the PDA to reload the running application somehow
degrade with time? Or does it depend on how much the device gets
knocked around? The registry settings are still intact, because I set
some of them in the application and they seem fine even after the
program has been restarted.

Rick: I have given thought to the logfile. It was infact going to be
my next step. I'm not sure it would pinpoint the problem, but it would
at least point me in the right direction.

Taha
  Reply With Quote
Old 17-04-2008, 06:03 AM   #6
Hilton
Guest
 
Posts: n/a
Default Re: Application gone after power on

The folks having the problem have installed the EXE on a card - right?

Hilton

"ataha" <ataha13@gmail.com> wrote in message
news:c084a952-17fc-4f38-8d22-0a77a082ed0d@8g2000hsu.googlegroups.com...
> I'm having a strange and almost undebuggable program. During my
> development, my PDA (a Socket SoMo, and previously an HP) is generally
> sitting in the cradle and it's powered through the night, so when I
> come back in the morning the application is still running and
> everything is fine.
>
> However, our sales people take out the PDAs now and the product is
> beginning to sell. Customers and salesfolk are finding that
> occasionally (once every 50 times or so) when the PDA is powered down,
> they power it up and find that the application is just not there. No
> exception or anything. It's just gone. Since the application disables
> the taskbar and it starts up automatically, this generally means they
> are sitting at the today screen and can't do anything. As a temporary
> fix, I will write a secondary application that keeps checking every 5
> seconds (or on power up) that the primary application is running and
> restarts it if it isn't.. but does anyone know how I can try to track
> this problem, or if it has been seen before.
>
> Any help would be appreciated.
> Taha



  Reply With Quote
Old 17-04-2008, 03:08 PM   #7
ataha
Guest
 
Posts: n/a
Default Re: Application gone after power on

On Apr 17, 1:03 am, "Hilton" <nos...@nospam.com> wrote:
> The folks having the problem have installed the EXE on a card - right?
>
> Hilton


Hilton: No it's installed on the device itself.

> I have seen this on older devices (older Windows Mobile devices). Not sure
> why the OS seems to change the Z order, this is probebly a bug or an
> application on the device causing it. You'll probebly find it is still
> running but just hidden, is this the case? and what ver of Windows Mobile do
> you have. You've put the device model but I can't be arsed to look it up to
> find out what version it is.


Simon: I'm using Windows Mobile 5.0 on a Socket Mobile SoMo 650. I
hadn't thought that it might still be there. I suppose it might. I'll
try to make a call to SetForegroundWindow after I detect power on and
see if that helps. Sometimes when this happens, the screen that is
shown is the File Explorer, and I can restart the application right
away. However, it is quite possible that the new app detects that the
old app is already running, gives it the foreground and quits (so that
only one copy of the app is running).

I'll see if that is the case.
Thanks
Taha
  Reply With Quote
Old 17-04-2008, 04:05 PM   #8
Paul G. Tobey [eMVP]
Guest
 
Posts: n/a
Default Re: Application gone after power on

The RAM filesystem and the registry storage are essentially the same. It's
possible, I guess, that the OS is telling your application to exit to save
battery when the device is suspended (I doubt that the power is actually
off, ever), and you aren't handling that properly.

Paul T.

"ataha" <ataha13@gmail.com> wrote in message
news:7312dd43-a4f5-493b-bc10-5bd5f0629ebc@s50g2000hsb.googlegroups.com...
> On Apr 16, 11:16 am, "Paul G. Tobey [eMVP]" <p space tobey no spam AT
> no instrument no spam DOT com> wrote:
>> Where is the EXE stored? I don't know anything about those particular
>> devices, but, if you're storing the application in the RAM filesystem, of
>> course, if the battery dies, it's gone. That would be my first guess.
>> You
>> might also check, perhaps by writing some values to the registry, whether
>> the registry is also going away at the same time.
>>
>> Paul T.
>>
>> "ataha" <atah...@gmail.com> wrote in message
>>
>> news:c084a952-17fc-4f38-8d22-0a77a082ed0d@8g2000hsu.googlegroups.com...
>>
>> > I'm having a strange and almost undebuggable program. During my
>> > development, my PDA (a Socket SoMo, and previously an HP) is generally
>> > sitting in the cradle and it's powered through the night, so when I
>> > come back in the morning the application is still running and
>> > everything is fine.

>>
>> > However, our sales people take out the PDAs now and the product is
>> > beginning to sell. Customers and salesfolk are finding that
>> > occasionally (once every 50 times or so) when the PDA is powered down,
>> > they power it up and find that the application is just not there. No
>> > exception or anything. It's just gone. Since the application disables
>> > the taskbar and it starts up automatically, this generally means they
>> > are sitting at the today screen and can't do anything. As a temporary
>> > fix, I will write a secondary application that keeps checking every 5
>> > seconds (or on power up) that the primary application is running and
>> > restarts it if it isn't.. but does anyone know how I can try to track
>> > this problem, or if it has been seen before.

>>
>> > Any help would be appreciated.
>> > Taha

>
> Paul: I don't mean a total power drainage of the device, I mean just a
> simple power off, power on, sometimes with a few days in between. Does
> the ability of the PDA to reload the running application somehow
> degrade with time? Or does it depend on how much the device gets
> knocked around? The registry settings are still intact, because I set
> some of them in the application and they seem fine even after the
> program has been restarted.
>
> Rick: I have given thought to the logfile. It was infact going to be
> my next step. I'm not sure it would pinpoint the problem, but it would
> at least point me in the right direction.
>
> Taha



  Reply With Quote
Old 17-04-2008, 05:00 PM   #9
ataha
Guest
 
Posts: n/a
Default Re: Application gone after power on

On Apr 17, 11:05 am, "Paul G. Tobey [eMVP]" <p space tobey no spam AT
no instrument no spam DOT com> wrote:
> The RAM filesystem and the registry storage are essentially the same. It's
> possible, I guess, that the OS is telling your application to exit to save
> battery when the device is suspended (I doubt that the power is actually
> off, ever), and you aren't handling that properly.


Hi Tobey.

Thanks for your reply. That is an interesting notion. If we assume
that your theory is correct and the OS is telling the app to exit, is
there any way to prevent my app from exiting? Or should I just try to
use something run like cerunappatevent and launch a small application
each time at power up that will see if my app is running and start it
if it is not?

Taha
  Reply With Quote
Old 17-04-2008, 05:10 PM   #10
Paul G. Tobey [eMVP]
Guest
 
Posts: n/a
Default Re: Application gone after power on

I'm not a Windows Mobile expert, except to the extent that it overlaps the
underlying OS, Windows CE. None of our devices, which are used in
industrial situations where they are always-on, suspend, so I'm not the best
guy to answer this.

The log file is the right way to answer the question, I think. Of course,
if you can just check the running programs list when the device comes up and
appears to be gone, that will tell you something (if there were three apps
running, including yours, before the suspend, and now there are none, it's
reasonable to assume that at least a soft reboot has occurred; if you're the
only one missing, your code is broken and a log is going to be required, I'd
think). Read through the information about suspend in the appropriate
Windows Mobile SDK and see what you can find.

Paul T.

"ataha" <ataha13@gmail.com> wrote in message
news:5ed48617-5471-4748-aa3f-40e154fd9ad1@b1g2000hsg.googlegroups.com...
> On Apr 17, 11:05 am, "Paul G. Tobey [eMVP]" <p space tobey no spam AT
> no instrument no spam DOT com> wrote:
>> The RAM filesystem and the registry storage are essentially the same.
>> It's
>> possible, I guess, that the OS is telling your application to exit to
>> save
>> battery when the device is suspended (I doubt that the power is actually
>> off, ever), and you aren't handling that properly.

>
> Hi Tobey.
>
> Thanks for your reply. That is an interesting notion. If we assume
> that your theory is correct and the OS is telling the app to exit, is
> there any way to prevent my app from exiting? Or should I just try to
> use something run like cerunappatevent and launch a small application
> each time at power up that will see if my app is running and start it
> if it is not?
>
> Taha



  Reply With Quote
Reply



Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off