pEpCOMServerAdapter.cpp
author Volker Birk <vb@pep-project.org>
Sun, 19 Jun 2016 07:59:43 +0200
changeset 88 659d0fc5bc30
parent 87 f0ce6a1a7118
child 89 56b26b1c4f3b
permissions -rw-r--r--
nicer
     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         gatekeeper_thread = new thread(gatekeeper, this);
    20         gatekeeper_thread->detach();
    21     }
    22 
    23 	DECLARE_LIBID(LIBID_pEpCOMServerAdapterLib)
    24 	DECLARE_REGISTRY_APPID_RESOURCEID(IDR_PEPCOMSERVERADAPTER, "{B3480081-82C0-4EE4-9AA1-3F513C9D78DD}")
    25 
    26 protected:
    27     static void gatekeeper(CpEpCOMServerAdapterModule * const self);
    28 
    29 private:
    30     thread *gatekeeper_thread;
    31 };
    32 
    33 void CpEpCOMServerAdapterModule::gatekeeper(CpEpCOMServerAdapterModule * const self)
    34 {
    35     GateKeeper keeper(self);
    36     keeper.keep();
    37 }
    38 
    39 CpEpCOMServerAdapterModule _AtlModule;
    40 
    41 //
    42 extern "C" int WINAPI _tWinMain(HINSTANCE /*hInstance*/, HINSTANCE /*hPrevInstance*/, 
    43 								LPTSTR /*lpCmdLine*/, int nShowCmd)
    44 {
    45     return _AtlModule.WinMain(nShowCmd);
    46 }
    47