123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263 |
- #ifndef _AKCOMSCOPE_H_
- #define _AKCOMSCOPE_H_
- #include <combaseapi.h>
- class CAkCOMScope
- {
- public:
- CAkCOMScope()
- : m_result(CoInitializeEx(NULL, COINIT_APARTMENTTHREADED))
- {
- }
- CAkCOMScope(DWORD dwCoInit)
- : m_result(CoInitializeEx(NULL, dwCoInit))
- {
- }
- ~CAkCOMScope()
- {
- if (SUCCEEDED(m_result))
- CoUninitialize();
- }
- HRESULT GetResult() const
- {
- return m_result;
- }
- private:
- HRESULT m_result;
- };
- #endif
|