I need some insight as to what might cause PocketFrog (0.8.1, I think) to stop processing events? I took the 'alpha' sample code and added a single line which ties into a .dll that should initialize a Compact Flash device. Although the device (LifeView's FlyGrabber) isn't remarkably stable, I've made it work before. But just initializing it makes it so that Stylus taps or Button clicks are no longer recognized. Oddly, the GameLoop() continues to run, but with no way to interact with it. The only thing to do is a soft reset. When I use debug mode and go through Game::Run() step by step, the problem doesn't occur and messages are still recognized. As soon as I remove the breakpoints and let the program run, no more messages are processed.
Any idea what could be causing this?
Joseph
Perhaps your Campact Flash device driver is removing input focus from your app.
Check if you are getting a WM_KILLFOCUS or a WM_ACTIVATE (with wparam == WA_INACTIVE).
It doesn't look like I'm getting any killFocus or Inactivate messages. Like I said, when I step through the for( ; ; ) loop in Game::Run() with the debugger, everything works fine and it continues to respond. The loop alternates between WM_PAINT events and running the GameLoop(). I can hit a key and the program responds. However, if I ever let it run (without the breakpoints), breakpoints cease to work anymore. The PDA doesn't talk to the development machine anymore at all and it doesn't respond to key or stylus events (although it's still updating the screen, so it must be responding to WM_PAINT?).
I wish I could test it without running through ActiveSync, but I have to do all my testing on the PDA because the CF device only works there.
Any other ideas for what might be causing the hangup?
Thanks,
Joseph
How do you handle the WM_PAINT message? If at all? If you don't, then it could explain why you are having problem. Windows will keep sending you WM_PAINT messages until you handle them.
Make sure you call BeginPaint() / EndPaint() when handling WM_PAINT (or add this code if you don't handle it yet):
- Code:
case WM_PAINT:
{
PAINTSTRUCT ps;
BeginPaint( hwnd, &ps; );
EndPaint( hwnd, &ps; );
}
break;
Thierry wrote:Make sure you call BeginPaint() / EndPaint() when handling WM_PAINT (or add this code if you don't handle it yet):
Oops. Sorry. The program doesn't alternate. I originally thought it kept on getting WM_PAINT messages because that was what was what was left in the msg struct because it was the last message pulled off the message queue by PeekMessage.
WM_PAINT is handled by the message map. After that it just runs through the GameLoop() when I step through it.