On 8/4/06, Richard Coutts <[EMAIL PROTECTED]> wrote:
I have a local event loop for my Palm app:

 do {
        EvtGetEvent(&event, evtNoWait);

        if (! SysHandleEvent(&event))
        if (! MenuHandleEvent(0, &event, &error))
             FormDispatchEvent(&event)

    } while (event.eType != appStopEvent && isDone == false);

 // main message loop:
 while (GetMessage(&msg, NULL, 0, 0))
 {
   TranslateMessage(&msg);
   DispatchMessage(&msg);
 }

then, you let your form handler do the rest. you need to always have
an active window for this - if you want to terminate; its quite simple
(the following code handles after the X is pressed); you can call the
PostQuitMessage(0); at any time tho

     case WM_DESTROY:
          PostQuitMessage(0);
          processed = true;
          break;

it is better to call DestroyWindow(g_hWnd); to simulate this call tho :)

my mainline in windows mobile still looks like:

     if (ApplicationInitialize())
     {
       g_initialized = true;

       InitApplication();
       EventLoop();
       EndApplication();

       g_initialized = false;
     }
     ApplicationTerminate();

just like it is on palmos :)

--
// Aaron Ardiri

--
For information on using the PalmSource Developer Forums, or to unsubscribe, 
please see http://www.palmos.com/dev/support/forums/

Reply via email to