home *** CD-ROM | disk | FTP | other *** search
/ Team Palmtops 7 / Palmtops_numero07.iso / WinCE / SDKWindowsCE / AutoPC / apcsdk10.exe / data1.cab / Win32_Samples / win32 / simpleclock / winmain.cpp < prev   
Encoding:
C/C++ Source or Header  |  1999-05-13  |  1.6 KB  |  79 lines

  1. /*+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
  2.  
  3. Copyright (c) 1998 Microsoft Corporation
  4.  
  5. Module Name:
  6.  
  7.     winmain.cpp
  8.  
  9. Abstract:
  10.  
  11.     Main Win32 Application entry point
  12.  
  13. Environment:
  14.  
  15.     AutoPC
  16.  
  17. -------------------------------------------------------------------*/
  18.  
  19. //Non-application header files
  20. #include <windows.h>
  21. #include <olectl.h>
  22. #include <asfc.h>        //Header for AS Forms Manager
  23. #include <ascmnctl.h>    //Header for AS Common Controls
  24.  
  25. #define APCDBG_INIT "SimpleClock"
  26. #include <apcdebug.h>
  27.  
  28. //Application specific header files
  29. #include "simpleclock.h"
  30.  
  31. //Global Application object
  32. CSimpleClockApp * g_pApp;
  33.  
  34. /*+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
  35. Function:
  36.     WinMain
  37.  
  38. Description:
  39.     Main Win32 Application entry point
  40.  
  41. Parameters:
  42.     Standard Win32 CE
  43. -------------------------------------------------------------------*/
  44.  
  45. int APIENTRY WinMain(HINSTANCE hInst,
  46.                      HINSTANCE hPrevInst,
  47.                      LPWSTR szCmd,
  48.                      int nCmdShow)
  49. {
  50.     MSG msg;
  51.  
  52.     g_pApp = new CSimpleClockApp(GetCurrentThreadId());
  53.     g_pApp->m_hInst = hInst;
  54.     CoInitializeEx(NULL, COINIT_MULTITHREADED);
  55.  
  56.     PeekMessage(&msg, NULL, 0, 0, PM_NOREMOVE);
  57.     if(g_pApp)
  58.     {
  59.         if(g_pApp->Init())
  60.         {
  61.             //Message loop
  62.             while (GetMessage(&msg, NULL, 0, 0)) 
  63.             {
  64.                 if (msg.hwnd)
  65.                 { 
  66.                     DispatchMessage(&msg);
  67.                 }
  68. /*                else
  69.                 {
  70.                     g_pApp->ProcessMessage(msg.message, msg.wParam, msg.lParam);    
  71.                 }*/
  72.             }
  73.         }
  74.         g_pApp->Clean();
  75.         delete g_pApp;
  76.     }
  77.     CoUninitialize();
  78.     return TRUE;
  79. }