4#ifndef _Stroika_Frameworks_Led_Platform_ATL_h_
5#define _Stroika_Frameworks_Led_Platform_ATL_h_ 1
15#include "Stroika/Frameworks/StroikaPreComp.h"
17static_assert (qStroika_HasComponent_ATLMFC,
18 "Error: Stroika::Framework::Led::Platform ATL code requires the ATLMFC feature to be set true");
23#include "Stroika/Frameworks/Led/Config.h"
24#include "Stroika/Frameworks/Led/Support.h"
26namespace Stroika::Frameworks::Led::Platform {
41 template <
typename BASE,
typename CTOR_ARGS>
42 class CComObjectWithARGS :
public BASE {
44 using inherited = BASE;
47 CComObjectWithARGS (
const CTOR_ARGS& args);
48 virtual ~CComObjectWithARGS () noexcept;
51 STDMETHOD_ (ULONG, AddRef)
53 STDMETHOD_ (ULONG, Release)
55 STDMETHOD (QueryInterface)
56 (REFIID iid,
void** ppvObject) noexcept;
65 template <typename BASE, typename CTOR_ARGS>
66 inline CComObjectWithARGS<BASE, CTOR_ARGS>::CComObjectWithARGS (const CTOR_ARGS& args)
71 template <
typename BASE,
typename CTOR_ARGS>
72 CComObjectWithARGS<BASE, CTOR_ARGS>::~CComObjectWithARGS () noexcept
74 this->m_dwRef = -(LONG_MAX / 2);
75 this->FinalRelease ();
76#ifdef _ATL_DEBUG_INTERFACES
77 _AtlDebugInterfacesModule.DeleteNonAddRefThunk (_GetRawUnknown ());
79 _pAtlModule->Unlock ();
81 template <
typename BASE,
typename CTOR_ARGS>
82 ULONG STDMETHODCALLTYPE CComObjectWithARGS<BASE, CTOR_ARGS>::AddRef ()
84 return this->InternalAddRef ();
86 template <
typename BASE,
typename CTOR_ARGS>
87 ULONG STDMETHODCALLTYPE CComObjectWithARGS<BASE, CTOR_ARGS>::Release ()
89 ULONG l = this->InternalRelease ();
95 template <
typename BASE,
typename CTOR_ARGS>
96 HRESULT STDMETHODCALLTYPE CComObjectWithARGS<BASE, CTOR_ARGS>::QueryInterface (REFIID iid,
void** ppvObject)
noexcept
99 return this->_InternalQueryInterface (iid, ppvObject);