Application closes while using Calculator

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I've built a .Net application that runs on a Pocket PC device. During
intermittent occasions, when the user moves from my application to the
Windows Calculator by clicking the start button, my application receives an
'application exit' message from the operating system and shuts down. The
message is sent while the user is using the Calculator and after the user has
gone back and forth (by closing and opening the Calculator) several times.

Memory usage is at about 50% with my app and the Calculator running at the
same time, so I don't think that is an issue.

Does anyone have any ideas as to why the operating system is closing my app?

Thanks!
 
The OS is detecting a low memory sitation and telling other apps to close to
free up resources. You app is getting that notification and obliging.

-Chris
 
There are a couple options. First is to close only when your app
explicityly does (so catch the Closing eve and bail if not). This requires
what I consider kludgy flags and logic, but works and has been used with
success.

Option 2, my preference, is to implement an IMessageFilter and catch the
message when it comes in (I'd grab WM_IBERNATE and WM_CLOSE), before the CF
message pump can grab and Dispatch it.

-Chris
 
Back
Top