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
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@86
    17
    CpEpCOMServerAdapterModule() : ATL::CAtlExeModuleT< CpEpCOMServerAdapterModule >(), gatekeeper_thread(NULL)
vb@86
    18
    {
vb@86
    19
        gatekeeper_thread = new thread(gatekeeper, this);
vb@86
    20
        gatekeeper_thread->detach();
vb@86
    21
    }
vb@86
    22
vb@0
    23
	DECLARE_LIBID(LIBID_pEpCOMServerAdapterLib)
vb@0
    24
	DECLARE_REGISTRY_APPID_RESOURCEID(IDR_PEPCOMSERVERADAPTER, "{B3480081-82C0-4EE4-9AA1-3F513C9D78DD}")
vb@86
    25
vb@88
    26
protected:
vb@88
    27
    static void gatekeeper(CpEpCOMServerAdapterModule * const self);
vb@88
    28
vb@86
    29
private:
vb@86
    30
    thread *gatekeeper_thread;
vb@0
    31
};
vb@0
    32
vb@86
    33
void CpEpCOMServerAdapterModule::gatekeeper(CpEpCOMServerAdapterModule * const self)
vb@86
    34
{
vb@86
    35
    GateKeeper keeper(self);
vb@86
    36
    keeper.keep();
vb@86
    37
}
vb@86
    38
vb@0
    39
CpEpCOMServerAdapterModule _AtlModule;
vb@0
    40
vb@0
    41
//
vb@0
    42
extern "C" int WINAPI _tWinMain(HINSTANCE /*hInstance*/, HINSTANCE /*hPrevInstance*/, 
vb@0
    43
								LPTSTR /*lpCmdLine*/, int nShowCmd)
vb@0
    44
{
vb@0
    45
    return _AtlModule.WinMain(nShowCmd);
vb@0
    46
}
vb@0
    47