WinStd Additional templates and function helpers for Microsoft Windows using Standard C++ classes

Public Member Functions | Protected Attributes | List of all members
winstd::com_initializer Class Reference
COM object management

Context scope automatic COM (un)initialization. More...

`#include <COM.h>`

## Public Member Functions
| com_initializer (_In_opt_ LPVOID pvReserved) noexcept
| Initializes the COM library on the current thread and identifies the concurrency model as single-thread apartment (STA). More...
| com_initializer (_In_opt_ LPVOID pvReserved, _In_ DWORD dwCoInit) noexcept
| Initializes the COM library for use by the calling thread, sets the thread's concurrency model, and creates a new apartment for the thread if one is required. More...
virtual | ~com_initializer ()
| Uninitializes COM. More...
HRESULT | status () const noexcept
| Return result of `CoInitialize()` call. More...

## Protected Attributes
HRESULT | m_result
| Result of CoInitialize call.

## Detailed Description

Context scope automatic COM (un)initialization.

## Constructor & Destructor Documentation

## ◆ com_initializer() [1/2]

winstd::com_initializer::com_initializer | ( | _In_opt_ LPVOID | pvReserved | ) |
| inline noexcept

Initializes the COM library on the current thread and identifies the concurrency model as single-thread apartment (STA).

See also
  CoInitialize function

## ◆ com_initializer() [2/2]

winstd::com_initializer::com_initializer | ( | _In_opt_ LPVOID | pvReserved,
|  | _In_ DWORD | dwCoInit
| ) |  |
| inline noexcept

Initializes the COM library for use by the calling thread, sets the thread's concurrency model, and creates a new apartment for the thread if one is required.

See also
  CoInitializeEx function

## ◆ ~com_initializer()

virtual winstd::com_initializer::~com_initializer | ( |  | ) |
| inline virtual

Uninitializes COM.

See also
  CoUninitialize function

## Member Function Documentation

## ◆ status()

HRESULT winstd::com_initializer::status | ( |  | ) | const
| inline noexcept

Return result of `CoInitialize()` call.

See also
  CoInitialize function

The documentation for this class was generated from the following file:

- include/WinStd/COM.h