mirror of
https://github.com/Jous99/F4MP.git
synced 2026-01-13 00:20:54 +01:00
17 lines
313 B
C
17 lines
313 B
C
|
|
#pragma once
|
||
|
|
|
||
|
|
#include <wrl.h>
|
||
|
|
|
||
|
|
// short alias
|
||
|
|
template <typename T> using ComPtr = Microsoft::WRL::ComPtr<T>;
|
||
|
|
|
||
|
|
struct ComScope
|
||
|
|
{
|
||
|
|
ComScope()
|
||
|
|
{
|
||
|
|
HRESULT hr = CoInitializeEx(nullptr, COINIT_APARTMENTTHREADED | COINIT_DISABLE_OLE1DDE);
|
||
|
|
(void)hr;
|
||
|
|
}
|
||
|
|
~ComScope() { CoUninitialize(); }
|
||
|
|
};
|