pEpCOMServerAdapter.cpp
author Volker Birk <vb@pep-project.org>
Sun, 19 Jun 2016 13:04:41 +0200
changeset 96 7c1816ce1dbd
parent 93 8bb66806109b
child 110 c643437f9b61
permissions -rw-r--r--
Updater infrastructure
     1 // pEpCOMServerAdapter.cpp : Implementation of WinMain
     2 
     3 
     4 #include "stdafx.h"
     5 #include "resource.h"
     6 #include "pEpCOMServerAdapter_i.h"
     7 #include "xdlldata.h"
     8 
     9 #include "GateKeeper.h"
    10 
    11 using namespace ATL;
    12 using namespace std;
    13 
    14 class CpEpCOMServerAdapterModule : public ATL::CAtlExeModuleT< CpEpCOMServerAdapterModule >
    15 {
    16 public:
    17     CpEpCOMServerAdapterModule() : ATL::CAtlExeModuleT< CpEpCOMServerAdapterModule >(), gatekeeper_thread(NULL)
    18     {
    19         try {
    20             gatekeeper_thread = new thread(gatekeeper, this);
    21             gatekeeper_thread->detach();
    22         }
    23         catch (system_error&) {
    24 
    25         }
    26     }
    27 
    28 	DECLARE_LIBID(LIBID_pEpCOMServerAdapterLib)
    29 	DECLARE_REGISTRY_APPID_RESOURCEID(IDR_PEPCOMSERVERADAPTER, "{B3480081-82C0-4EE4-9AA1-3F513C9D78DD}")
    30 
    31 protected:
    32     static void gatekeeper(CpEpCOMServerAdapterModule * const self);
    33 
    34 private:
    35     thread *gatekeeper_thread;
    36 };
    37 
    38 void CpEpCOMServerAdapterModule::gatekeeper(CpEpCOMServerAdapterModule * const self)
    39 {
    40     pEp::GateKeeper keeper(self);
    41     keeper.keep();
    42 }
    43 
    44 CpEpCOMServerAdapterModule _AtlModule;
    45 
    46 //
    47 extern "C" int WINAPI _tWinMain(HINSTANCE /*hInstance*/, HINSTANCE /*hPrevInstance*/, 
    48 								LPTSTR /*lpCmdLine*/, int nShowCmd)
    49 {
    50     return _AtlModule.WinMain(nShowCmd);
    51 }
    52