Fog Creek Software
Discussion Board

Persistent app in Win CE

Hi all,

I'd like to get an advice from an expert in WinCE. This OS can kill an app if memory is very low. I need my app to be a survivor.

The app is always running in a background. I can influence the platform creation -- I work for an OEM.

Thanks for all the help!

Wednesday, May 14, 2003

Sorry, no real advice but maybe news://microsoft.public.win32.programmer.wince is a good place for help on this?
MS seems pretty eager lately in getting their own developers out on the newsgroups helping people

Just me (Sir to you)
Wednesday, May 14, 2003

I've done WinCE and Pocket PC development, but I don't know of a way to prevent the OS from killing your app.

Before your app is killed, the OS sends you a WM_HIBERNATE message. If you "shed" enough memory load at that time, you might prevent the OS from killing your app. Unfortunatetly, nothing prevents other, misbehaved apps from using more memory and squeezing your app out of memory.

If you find an answer, I would definitely be curious to hear about it!

Wednesday, May 14, 2003

If you're at the OEM level, then you can turn your app into a device driver for your platform maybe.

Wednesday, May 14, 2003

On the microsoft.public.smartphone.developer newsgroup, I just read a suggestion to make your application a DLL plugin to the "Today" home page app. Pocket PC won't kill the Today app, so if your app is within it, you might be safe.

Wednesday, May 14, 2003

If I recall correctly, the SysInfo (?) OCX has one or two events that you can trap for this, and you can respond in one of two ways, either dumping memory, or dumping your app.

I'm still hazy on it, so looking it up in MSDN might help you out a bit.

Geoff Bennett
Wednesday, May 14, 2003

Azazello, you have completely the wrong approach. Probably you're don't have a background in Windows development?

Your application has to adapt to the demands of the environment and of the user, instead of presuming you can rule it. It is not hard to do. You must respond to the hibernate requests.

Be a good citizen of the Windows world.

Must be a manager
Wednesday, May 14, 2003

I believe having a  socket open (and possibly connected) ensures that you aren't killed.

That's because network applications can't simply store their state when asked by the OS to do so, because the "state" isn't local any more.

(Since you're working for an OEM, I trust that you do indeed have a legitimate requirement for not being shut down by the OS.)

Good luck!

Kaushik Sridharan
Wednesday, May 14, 2003

Thanks to everybody!

Yes, I do have a legitimate reason to have a persistent app. Mind you, certain MS apps are persistent. Should they be cited for bad citizenship?

I can try to ask MS directly. Working for OEM gives me a chance to even have an answer! :)

Thursday, May 15, 2003

*  Recent Topics

*  Fog Creek Home