home *** CD-ROM | disk | FTP | other *** search
- /*+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
-
- Copyright (c) 1998 Microsoft Corporation
-
- Module Name:
-
- winmain.cpp
-
- Abstract:
-
- Main Win32 Application entry point
-
- Environment:
-
- AutoPC
-
- -------------------------------------------------------------------*/
-
- //Non-application header files
- #include <windows.h>
- #include <olectl.h>
- #include <asfc.h> //Header for AS Forms Manager
- #include <ascmnctl.h> //Header for AS Common Controls
-
- #define APCDBG_INIT "SimpleClock"
- #include <apcdebug.h>
-
- //Application specific header files
- #include "simpleclock.h"
-
- //Global Application object
- CSimpleClockApp * g_pApp;
-
- /*+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
- Function:
- WinMain
-
- Description:
- Main Win32 Application entry point
-
- Parameters:
- Standard Win32 CE
- -------------------------------------------------------------------*/
-
- int APIENTRY WinMain(HINSTANCE hInst,
- HINSTANCE hPrevInst,
- LPWSTR szCmd,
- int nCmdShow)
- {
- MSG msg;
-
- g_pApp = new CSimpleClockApp(GetCurrentThreadId());
- g_pApp->m_hInst = hInst;
- CoInitializeEx(NULL, COINIT_MULTITHREADED);
-
- PeekMessage(&msg, NULL, 0, 0, PM_NOREMOVE);
- if(g_pApp)
- {
- if(g_pApp->Init())
- {
- //Message loop
- while (GetMessage(&msg, NULL, 0, 0))
- {
- if (msg.hwnd)
- {
- DispatchMessage(&msg);
- }
- /* else
- {
- g_pApp->ProcessMessage(msg.message, msg.wParam, msg.lParam);
- }*/
- }
- }
- g_pApp->Clean();
- delete g_pApp;
- }
- CoUninitialize();
- return TRUE;
- }