home *** CD-ROM | disk | FTP | other *** search
- /*+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
-
- Copyright (c) 1998 Microsoft Corporation
-
- Module Name:
-
- winmain.cpp
-
- Abstract:
-
- WinMain entry point for SR sample app. Creates and inits main
- application class and contains the message loop.
-
- Environment:
-
- AutoPC
-
- -------------------------------------------------------------------*/
- #include <windows.h>
- #include <olectl.h>
- #include <asfc.h>
- #include <ascmnctl.h>
-
- #define APCDBG_INIT "SR App" // Define used for debug
- #include <apcdebug.h>
-
- #include "resource.h"
- #include "appsink.h"
- #include "app.h"
-
- // Global App object
- extern CSRApp* g_pApp;
-
- //+-------------------------------------------------------------------------
- //
- // Function: WinMain
- //
- // Synopsis: Main Win32 entry point
- //
- // Arguments: Standard Win32 WinMain arguments
- //
- // Returns: TRUE on app exit
- //
- //---------------------------------------------------------------------------
- int APIENTRY WinMain(HINSTANCE hInst,
- HINSTANCE hPrevInst,
- LPWSTR szCmd,
- int nCmdShow)
- {
- MSG msg;
-
- // Create new application object
- g_pApp = new CSRApp(hInst);
-
- if(!g_pApp)
- {
- DEBUGMSG(ZONE_ERROR, (L"SRApp: Ran out of memory allocation main Application class object"));
- goto LReturn;
- }
-
- if(!(g_pApp->Init()))
- {
- DEBUGMSG(ZONE_ERROR, (L"SRApp: Application Init() failed.\n"));
- goto LReturn;
- }
-
- // Main message loop.
- while(GetMessage(&msg, NULL, 0, 0))
- {
- DispatchMessage(&msg);
- }
-
- LReturn:
-
- if(g_pApp)
- delete g_pApp;
-
- return TRUE;
- }
-