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