NO

Author Topic: Trouble with Reversi on Mobile 5.0  (Read 2712 times)

Kurt

  • Guest
Trouble with Reversi on Mobile 5.0
« on: June 01, 2007, 06:20:14 pm »
I have access to a Pocket PC running Windows Mobile version 5.0 (OS 5.1.195). The asmdemo and edbapp applications build and execute properly, but I'm having trouble with the reversi demonstration. For some reason, the menu functions and title bar close button don't work as expected. In fact, to close the application I need to terminate it from the settings / system / memory / running programs list. I tried compiling and linking the program with the Windows Mobile 5.0 Pocket PC SDK but ran into issues with __unaligned and PCONTEXT in winnt.h, and __stdcall / __cdecl in strsafe.h.

Has anyone else encountered this? If so, is there a workaround?

Thanks,

Kurt

Kurt

  • Guest
Re: Trouble with Reversi on Mobile 5.0
« Reply #1 on: June 01, 2007, 08:21:28 pm »
Quote
For some reason, the menu functions and title bar close button don't work as expected.

I've narrowed the scope of the problem. The window handle of the menu bar created with a call to SHCreateMenuBar is stored in a global variable named g_hwndMB. The WM_COMMAND handler expects the window handle that is passed in to be that of the menu bar but, at least with the version of Mobile 5 I am working with, this isn't the case.

The reversi demonstration already has a workaround to deal with the extended window creation flag when running on Pocket PC 2002; I guess I'll need to hack in something to accommodate Mobile 5, too.

Kurt

Offline Pelle

  • Administrator
  • Member
  • *****
  • Posts: 1974
    • http://www.smorgasbordet.com
Re: Trouble with Reversi on Mobile 5.0
« Reply #2 on: June 05, 2007, 09:29:32 am »
It looks like the code in Main_OnCommand() is more complex that it needs to be. The test against g_hwndMB should be removed, and everything folded into a single switch case. This should work on older versions too, I think...
/Pelle

Kurt

  • Guest
Re: Trouble with Reversi on Mobile 5.0
« Reply #3 on: June 06, 2007, 02:00:14 am »
Quote
The test against g_hwndMB should be removed, and everything folded into a single switch case.

Right you are, Pelle -- thanks!

--
Kurt