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