Page 1 of 1

EasyCE & Simulator Starting Qs

PostPosted: Sep 9, 2002 @ 6:16am
by Saul
Hey, I'm trying to figure out the how to use EasyCE with the x86 emulator (on W2K). So far I've figured out the following from this site:

Download the GAPI emulator and copy the gx.* files to the Windows directory.

Download a sample windows app (in this case, SampleApp). (I'm working with EasyCE 1.6 at the moment, I ran into too much difficult with the 2.0 version modified for the simulator so I backed off to something easier.)

I've successfully compiled it and run it on my actual iPaQ after some minor difficulties with properly configuring the libraries and such.

However, when I try and run it on the simulator, it produces an illegal memory access error. When I step through the program with the debugger, the problem seems to be that in the function void taskbar (bool)
the code
RECT rc;
GetWindowRect( hWnd, &rc );
HWND hWndTB=FindWindow(TEXT"HHTaskbar"),NULL);

crashes on the second line because hWnd is defined to be 0 and that is protected memory. I realized that hWnd doesn't look to be defined until bool initinstance(HInstance, int) is called a few lines later in WinMain. That is, the WinMain function has the lines:
1: taskbar( false );
2: resettimer();
3: if (!MyRegisterClass(hInstance)) return FALSE;
4: if (!InitInstance (hInstance, nCmdShow)) return FALSE;

and the program crashes in 1 while hWnd isn't defined until 4 when the window is created.

I tried rearranging those lines to
1: resettimer();
2: if (!MyRegisterClass(hInstance)) return FALSE;
3: if (!InitInstance (hInstance, nCmdShow)) return FALSE;
4: taskbar( false );

but then the program crashes in InitInstance on the line hWnd = CreateWindow(wincls, szTitle, WS_POPUP, CW_USEDEFAULT, CW_USEDEFAULT, 240, 320, 0, 0, hi, 0); with another illegal exception.

I guess my question is two-fold: Am I completely misreading the problem, and ought the code to work on the emulator? And two, if it doesn't work on the emulator, why does it work fine on my actual iPaq? I know the two aren't identical platforms, but I'm not quite sure what to attribute the problems to.

Thanks ahead of time for any insight.

PostPosted: Sep 9, 2002 @ 6:26am
by goatCE
I sense it now...the onslaught of "take it to the developer forum".
some insight: nobody likes the ppc emulator.

EasyCE & Simulator Starting Qs

PostPosted: Sep 9, 2002 @ 10:20am
by BurningSheep