Hi All,

Recently I ran into a problem (a crash) that has everything to do with
Pocket PC 3.0 Emulator (comes with Pocket PC 3.0 SDK).

I have been working on developing applications (MFC - EVC 3.0) for windows
CE and Pocket PC for 4 years now. Everything was going fine until I started
getting this weird behavior on the emulator on some of the machines (not
all). When I run my application (the application that I'm developing) the
emulator crashes after a random time (1 sec - 1 min). The error message that
gets displayed indicates that shell32.exe (emulator's executable) was trying
to read from address xxxx and the memory could not be read. When I hit OK my
application gets closed.

Similar behavior does not occur on the real handhelds and never happens on
the emulator on many other desktop machines.

I know some of you might say that the program I'm writing seems to have a
problem. I don't like to think like this because the program runs perfectly
on the emulator on other machines and on the real handhelds.

The facts are:
- I'm using EVC 3.0 for development.
- The project is based on MFC.
- The emulator causing this is the Pocket PC emulator that comes with Pocket
PC 3.0 SDK.
- Not all desktop machines have this problem but the number of machines that
have this is huge
- All the machines that have this emulator problem are up to date (Latest
service packs, latest updates from Microsoft, etc...)

Can anyone help me figure out what is going on?
Have anyone encountered something similar to this?

Thanks,
Khalid.

Re: Emulator Crash by r_z_aret

r_z_aret
Wed Dec 29 13:02:19 CST 2004

On Wed, 29 Dec 2004 00:53:04 -0800, "Khalid Omar"
<KhalidOmar@discussions.microsoft.com> wrote:

>Hi All,
>
>Recently I ran into a problem (a crash) that has everything to do with
>Pocket PC 3.0 Emulator (comes with Pocket PC 3.0 SDK).
>
>I have been working on developing applications (MFC - EVC 3.0) for windows
>CE and Pocket PC for 4 years now. Everything was going fine until I started
>getting this weird behavior on the emulator on some of the machines (not
>all). When I run my application (the application that I'm developing) the
>emulator crashes after a random time (1 sec - 1 min). The error message that
>gets displayed indicates that shell32.exe (emulator's executable) was trying
>to read from address xxxx and the memory could not be read. When I hit OK my
>application gets closed.
>
>Similar behavior does not occur on the real handhelds and never happens on
>the emulator on many other desktop machines.
>
>I know some of you might say that the program I'm writing seems to have a
>problem. I don't like to think like this because the program runs perfectly
>on the emulator on other machines and on the real handhelds.

Several times when I've seen a symptom on only one platform, the
culprit was a bug in _my_ program that just happened to show no
symptoms on other platforms. In particular, when I started several
years ago, several bugs showed only on SH3 CPUs. Not on MIPS. And not
on "big" Windows. So I'm wary of claiming innocence just because a bug
shows only on a narrow subset of the platforms I've tried.

I recently found a bug that was bothering me for a long time, and gave
symptoms similar to yours. I define the following macro:
#define INVALID_HWND_VALUE static_cast<HWND>(INVALID_HANDLE_VALUE)
If I pass INVALID_HWND_VALUE to ::IsWindow, I see a message about
invalid memory access, the program stack is empty, and my program
hangs. The problem showed only when I was actively debugging my
program. It did not show when I ran debug builds. I already called the
function primarily from a wrapper function, so the workaround was
pretty simple:
1) always use my wrapper
2) check the input value before calling IsWindow and return FALSE if
the value is INVALID_HWND_VALUE.

How I tracked down that bug is somewhat instructive. For various
reasons I can't quite articulate, I figured the problem was in a
destructor. So I made a best guess about what destructor was causing
the problem, put a breakpoint in it, and ran the program. I soon
discovered the problem did not occur in my explicit code. So I stepped
through the assembler code. Fortunately, that includes comments with
the corresponding source code. That let me track down the destructor
that actually called IsWindow. Not fun, but worth the effort.

>
>The facts are:
>- I'm using EVC 3.0 for development.
>- The project is based on MFC.
>- The emulator causing this is the Pocket PC emulator that comes with Pocket
>PC 3.0 SDK.
>- Not all desktop machines have this problem but the number of machines that
>have this is huge
>- All the machines that have this emulator problem are up to date (Latest
>service packs, latest updates from Microsoft, etc...)
>
>Can anyone help me figure out what is going on?
>Have anyone encountered something similar to this?
>
>Thanks,
>Khalid.

-----------------------------------------
To reply to me, remove the underscores (_) from my email address (and please indicate which newsgroup and message).

Robert E. Zaret, eMVP
PenFact, Inc.
500 Harrison Ave., Suite 3R
Boston, MA 02118
www.penfact.com

Re: Emulator Crash by David

David
Thu Dec 30 16:49:20 CST 2004

Yes, I've seen similar crashes in Shell32 with MFC only (due to bugs in my
code).

David
------
This posting is provided "AS IS" with no warranties, and confers no rights.

<r_z_aret@pen_fact.com> wrote in message
news:qjs5t01isrqhc2q96rfq0tg53h3862vpei@4ax.com...
> On Wed, 29 Dec 2004 00:53:04 -0800, "Khalid Omar"
> <KhalidOmar@discussions.microsoft.com> wrote:
>
> >Hi All,
> >
> >Recently I ran into a problem (a crash) that has everything to do with
> >Pocket PC 3.0 Emulator (comes with Pocket PC 3.0 SDK).
> >
> >I have been working on developing applications (MFC - EVC 3.0) for
windows
> >CE and Pocket PC for 4 years now. Everything was going fine until I
started
> >getting this weird behavior on the emulator on some of the machines (not
> >all). When I run my application (the application that I'm developing) the
> >emulator crashes after a random time (1 sec - 1 min). The error message
that
> >gets displayed indicates that shell32.exe (emulator's executable) was
trying
> >to read from address xxxx and the memory could not be read. When I hit OK
my
> >application gets closed.
> >
> >Similar behavior does not occur on the real handhelds and never happens
on
> >the emulator on many other desktop machines.
> >
> >I know some of you might say that the program I'm writing seems to have a
> >problem. I don't like to think like this because the program runs
perfectly
> >on the emulator on other machines and on the real handhelds.
>
> Several times when I've seen a symptom on only one platform, the
> culprit was a bug in _my_ program



Re: Emulator Crash by David

David
Thu Dec 30 16:52:05 CST 2004

Have you tried the updated emulator? I mean the updated emulator engine
version 4.2 from:
"Microsoft Windows CE .NET 4.2 Device Emulator"
http://www.microsoft.com/downloads
This works with eVC 3.0 and Pocket PC 2002 SDK (and resolves a 2002 emulator
crash problem, supposedly related to buggy display or audio driver).

However, it looks like it was replaced with the CE 5.0 Emulator:
https://www.microsoft.com/downloads/details.aspx?FamilyID=a120e012-ca31-4be9-a3bf-b9bf4f64ce72&DisplayLang=en

Let us know if this update this makes a difference.

David
------
This posting is provided "AS IS" with no warranties, and confers no rights.

"Khalid Omar" <KhalidOmar@discussions.microsoft.com> wrote in message
news:EB6FE02A-7DC1-45F9-B06F-40710A5139BB@microsoft.com...
>
> When I run my application (the application that I'm developing) the
> emulator crashes after a random time (1 sec - 1 min). The error message
that
> gets displayed indicates that shell32.exe (emulator's executable) was
trying
> to read from address xxxx and the memory could not be read. When I hit OK
my
> application gets closed.
> ...
> - All the machines that have this emulator problem are up to date (Latest
> service packs, latest updates from Microsoft, etc...)