pEpCOMServerAdapter.h
author Volker Birk <vb@pep-project.org>
Tue, 21 Jun 2016 19:24:54 +0200
changeset 110 c643437f9b61
child 140 3975758c4320
permissions -rw-r--r--
store updateKey in resource table
     1 #include "stdafx.h"
     2 
     3 #include "pEpCOMServerAdapter_i.h"
     4 
     5 using namespace ATL;
     6 using namespace std;
     7 
     8 class CpEpCOMServerAdapterModule : public ATL::CAtlExeModuleT< CpEpCOMServerAdapterModule > {
     9 public:
    10     CpEpCOMServerAdapterModule() : ATL::CAtlExeModuleT< CpEpCOMServerAdapterModule >(), gatekeeper_thread(NULL), _hModule(NULL)
    11     {
    12     }
    13 
    14     DECLARE_LIBID(LIBID_pEpCOMServerAdapterLib)
    15     DECLARE_REGISTRY_APPID_RESOURCEID(IDR_PEPCOMSERVERADAPTER, "{B3480081-82C0-4EE4-9AA1-3F513C9D78DD}")
    16 
    17     HMODULE hModule()
    18     {
    19         return _hModule;
    20     }
    21 
    22     void hModule(HMODULE m)
    23     {
    24         _hModule = m;
    25     }
    26 
    27     void start_gatekeeper()
    28     {
    29         try {
    30             gatekeeper_thread = new thread(gatekeeper, this);
    31             gatekeeper_thread->detach();
    32         }
    33         catch (system_error&) {
    34 
    35         }
    36     }
    37 
    38 protected:
    39     static void gatekeeper(CpEpCOMServerAdapterModule * self);
    40 
    41 private:
    42     thread *gatekeeper_thread;
    43     HMODULE _hModule;
    44 };