|
////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2006 Werner Willemsens
//
////////////////////////////////////////////////////////////////////
// Gate.h : Declaration of the CGate
#pragma once
#ifdef STANDARDSHELL_UI_MODEL
#include "resource.h"
#endif
#ifdef POCKETPC2003_UI_MODEL
#include "resourceppc.h"
#endif
#ifdef SMARTPHONE2003_UI_MODEL
#include "resourcesp.h"
#endif
#ifdef AYGSHELL_UI_MODEL
#include "resourceayg.h"
#endif
#include "StarGatePS.h"
#include "_IGateEvents_CP.h"
#define MIN_CHEVRON_COUNT 7 // 7, only our galaxy
#define MAX_CHEVRON_COUNT 9 // 9, we might even dial Atlantis :-)
#define MAX_CHEVRON_SYMBOL 39
// CGate
class ATL_NO_VTABLE CGate :
public CComObjectRootEx<CComMultiThreadModel>,
public CComCoClass<CGate, &CLSID_Gate>,
public ISupportErrorInfo,
public IConnectionPointContainerImpl<CGate>,
public CProxy_IGateEvents<CGate>,
public IDispatchImpl<IGate, &IID_IGate, &LIBID_StarGateLib, /*wMajor =*/ 1, /*wMinor =*/ 0>
{
public:
CGate();
~CGate();
#ifdef _CE_DCOM
DECLARE_REGISTRY_RESOURCEID(IDR_GATEDCOM)
#endif
BEGIN_COM_MAP(CGate)
COM_INTERFACE_ENTRY(IGate)
COM_INTERFACE_ENTRY(IDispatch)
COM_INTERFACE_ENTRY(ISupportErrorInfo)
COM_INTERFACE_ENTRY(IConnectionPointContainer)
END_COM_MAP()
BEGIN_CONNECTION_POINT_MAP(CGate)
CONNECTION_POINT_ENTRY(__uuidof(_IGateEvents))
END_CONNECTION_POINT_MAP()
// ISupportsErrorInfo
STDMETHOD(InterfaceSupportsErrorInfo)(REFIID riid);
DECLARE_NOT_AGGREGATABLE(CGate)
// In case you only have 1 working StarGate :-)
// DECLARE_CLASSFACTORY_SINGLETON(CGate)
DECLARE_PROTECT_FINAL_CONSTRUCT()
HRESULT FinalConstruct()
{
return S_OK;
}
void FinalRelease()
{
}
public:
STDMETHOD(DialGate)(LONG Chevron);
STDMETHOD(CloseGate)();
STDMETHOD(get_IsOpen)(VARIANT_BOOL* pVal);
protected:
// Handles Opened() events
void ProcessOpened(VARIANT *aValue);
protected:
long m_ChevronEntered[MAX_CHEVRON_COUNT];
long m_ChevronCount;
CRITICAL_SECTION m_ChevronProtect;
};
OBJECT_ENTRY_AUTO(__uuidof(Gate), CGate)
|
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please
let us know and we'll add colourisation support for it.
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.