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

  1. //--------------------------------------------------------------------------------------------
  2. //
  3. //  THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF 
  4. //  ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO 
  5. //  THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A 
  6. //  PARTICULAR PURPOSE.
  7. //
  8. //    Copyright (c) Microsoft Corporation, 1997 All Rights Reserved
  9. //
  10. //    Description:
  11. //        
  12. //        Contains the base application level code and classes for a simple Apollo application
  13. //
  14. //--------------------------------------------------------------------------------------------
  15. #include <windows.h>
  16. #include <olectl.h>
  17. #include <asfc.h>
  18. #include <ascmnctl.h>
  19. #include <keypad.h>
  20.  
  21. #define APCDBG_INIT        "TTS Demo"
  22. #include <apcdebug.h>
  23.  
  24.  
  25. #include "resource.h"
  26. #include "appsink.h"
  27. #include "app.h"
  28.  
  29. //--------------------------------------------------------------------------------------------
  30. //
  31. // Globals
  32. //
  33. //--------------------------------------------------------------------------------------------
  34.  
  35. CTTSApp* g_pApp = NULL;
  36.  
  37. //--------------------------------------------------------------------------------------------
  38. //
  39. // Functions
  40. //
  41. //--------------------------------------------------------------------------------------------
  42.  
  43. //+-------------------------------------------------------------------------
  44. //
  45. //    Function: WinMain
  46. //
  47. //    Synopsis: Main Win32 entry point
  48. //
  49. //    Arguments: Standard Win32 WinMain arguments
  50. //
  51. //     Returns:  TRUE on app exit
  52. //
  53. //---------------------------------------------------------------------------
  54.  
  55. // Main Win32 entry point
  56.  
  57. int APIENTRY WinMain(HINSTANCE hInst, HINSTANCE hPrevInst, LPWSTR szCmd, int nCmdShow)
  58. {
  59.     MSG    msg;
  60.  
  61.     // Peek message to ensure that thread is ready for PostThreadMsg calls
  62.     PeekMessage(&msg, NULL, 0, 0, PM_NOREMOVE);
  63.  
  64.     g_pApp = new CTTSApp( hInst );
  65.     if( g_pApp == NULL ) goto LReturn;
  66.  
  67.     if(!g_pApp->Init()) goto LReturn;
  68.  
  69.     while (GetMessage(&msg, NULL, 0, 0)) 
  70.     {
  71.         DispatchMessage(&msg);
  72.     }
  73.  
  74. LReturn:   
  75.  
  76.     if(g_pApp) delete g_pApp;
  77.  
  78.     return TRUE; 
  79. }
  80.