weird quit of PPC App ???

  • Thread starter Thread starter Khanh
  • Start date Start date
K

Khanh

hi all,

Sometimes our App find out a very weird phenomenon, our App quit
without any exception, any warning !!!! It's not the Quit click, it
quits out of our control. Is there a problem of memory leak, or
anything else ????
Currently we intend to log error for tracking what happen, but we
really don't where we have to log !!!!
What shoud we do now???

Thanks much,
Khanh
 
if your app is not foreground it might be send quit message by the system to
free memory
 
nope, it seems you misunderstand me, I means my App exited without my
intention, it just exit and disappear, no exception, nothing at all.

K
 
Dear Khanh,

if your App is put into the Background the OS might send a
Quit-Message to your app in order to free up some memory. You can
check this, by adding a dispose-Event to your form which is put into
the background. If this event gets fired without any action from your
side, this is an indication for the message send by the OS.

The only thing i can imagine to solve this issue, is to catch es
Message at the message queue and discard it there if it is send by the
OS. Alternatively you can discard the dispose-event, if it is
possible.

The problem with the OS sending this message only occurs if the APP is
in the Background (all forms are hidden).

Hope this helps

Greetz

Jens
 
K,

Is anything else happening on the device when the app quits? Sometimes this
happens on phones when a call comes in and the OS needs more memory. Does
this also happen in the emulator, or only on the device?

--
Ginny Caughey
..Net Compact Framework MVP

Have an opinion on the effectiveness of Microsoft Embedded newsgroups?
Let Microsoft know!
https://www.windowsembeddedeval.com/community/newsgroups
 
ok, if your app is forground but excit mysteriously have you think about
running into the debuger/ VS.net ?!

if it doesn't happen while you test, what about a try {} catch{} around
Application.Run() and a small error box ?
 
Dear Jens and all of you,

Thank you very much for your replies.
Regarding our Pocket PC App, it is not in backgroud at all, our app
has total of 37 forms, and interacting with user very much. Our model
of showing form as follows:
Login form (start-up form) -> show form Main, hide form Login ->
etc,... that means there always exists at least 2 forms Login & Main
evrytime. We open form by Show method (not showdialog method).
SOMETIMES, our App is existed sudenly without any action from user,
any exception, any warning!!! We really don't know why this happens.
We want to log error for tracking but we don't know what to log.

Hope to hearing from you all,
Regards,
Khanh
 
sorry, I would like to give some information:

When app is exited suddenly, nothing happens on device. We didn't test
much on Emulator because it's very slow and can't load our main form
(bigger than 64 KBs of code for Loading method)
Our device: Fujitsu Loox FLX3AW

Khanh
 
any other idea pls?
sorry, I would like to give some information:

When app is exited suddenly, nothing happens on device. We didn't test
much on Emulator because it's very slow and can't load our main form
(bigger than 64 KBs of code for Loading method)
Our device: Fujitsu Loox FLX3AW

Khanh
 
Have you ever tried to catch the disposeevent in your Form? If the app
exits and an disposeevent gets fired, the OS send an exit message to
your app. In this case i dont know how to prevent it.

Jens


*** Sent via Devdex http://www.devdex.com ***
Don't just participate in USENET...get rewarded for it!
 
hi Jen and everyone,

I would like to remind again, I have 2 forms to be showed at the
same time, form Login to be hidden, and form Main to be showed. And
although I've tried to catch all events Closed, Dispose of 2 forms, my
Pocket App is still exited suddenly sometimes and no event fired !!!!
At first, I think of low memory, but the App can be exited right at
start-up form Login, it flashed for a second then closed. In short, it
can exit in any form.
In general, I feel .NET compact framework and WebService are still
in development phase, and they are very unstable.

So could you please give me a snippet of code for catching exit
event?
Does anyone meet the same as my case? It really makes me crazy.
Any help would be very welcome.

Regards,
Khanh
 
Khanh:

We had a similiar problem when we started putting our program in the
background to run other .NET applications that ate up too much memory. One
way to catch and stop the OS from sending a close is to create a flag in your
program is much like a watchdog, something like:

boolean exitedNormally = false;

Then, everywhere your users exit the application as you would expect set
this flag to true. Then in your Form closing method, check the flag to see
if it is true, indicating it was a normal exit. If it was not, disallow the
close, for instance:

private void Closing(object sender, System.ComponentModel.CancelEventArgs e)
{
if (!exitedNormally)
{
e.Cancel = true;
}
}

Good luck,

Jason Seaton
 
Back
Top