Re: Please explain "Always Running" mentality of Windows CE

From: The PocketTV Team (do-not-reply-by-email_at_pockettv.com)
Date: 08/13/04


Date: Thu, 12 Aug 2004 20:26:42 -0700

I think well-programmed applications should close all the resources, opened
files, opened databases etc, as soon as they are de-activated, and re-opened
them when re-activated.

That's exactly what we do in PocketTV.

If that was the case, then you would not have the type of problem that you
describe.

Before, when we did not close the currently opened file when de-activated,
people would call us to complain that they cannot delete the MPEG file or
download a new one with the same name. We had to explain them that it was
because the file was currently opened by the applications. Then they would
ask why, since they close the applications. Then we would have to explain
that tapping the X button does not really close the applications, it justs
de-activates it and hides it.

Basically, when an application is de-activated, it should behave as much as
possible like if it was closed (i.e. process terminated), i.e. it should
release all opened resources and save its state.

When the application is activated, it should re-open all the system
resources that it needs.

The only difference between re-activating a de-activated app and starting
the app is that it is faster, because all the initialization is already
performed. That's the only difference that should be visible to the user.

Unfortunately MSFT does a very poor job of explaining all that to
developers, so most developers don't know what to do when the application is
de-activated (i.e. "minimized"). The vast majority of applications do not
close/release theyr resources, for example, and that's a sin. But MSFT has
no way to "enforce" good behavior.

Basically, MSFT's system works well only if all the applications follow a
number of guidelines, but they have no way to enforce this, so their system
does not work very well, because many apps (including some from MSFT) don't
follow the guidelines as they should.

"David D Webb" <spivey@nospam.post.com> wrote in message
news:%23541zfLgEHA.3320@TK2MSFTNGP11.phx.gbl...
> I plan to give a real close button in my app and an Exit menu option, but
> its all of the other apps running that worry me. The more apps that are
> running, the more likely something will go wrong or some resource will be
> left open or some process will drain the system.
>
> For example, my app uses an SQLCE database file. If a user clicks on that
> database file and has SQL Analyzer installed, Analyzer will open the file.
> Analyzer has an X icon instead of an OK icon, so it only truely closes if
> you select the menu option to exit. If they just click the X, that
database
> file is left open and my app can't attach to it.
>
> Why didn't they just do like Windows, and provide a close (X) and a
minimize
> (_) button. Why the heck is X minimize??
>
> And I thought Palm was frustrating.... (-;