forked from CobaltFusion/DebugViewPP
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCom.cpp
More file actions
29 lines (24 loc) · 753 Bytes
/
Copy pathCom.cpp
File metadata and controls
29 lines (24 loc) · 753 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
// (C) Copyright Gert-Jan de Vos and Jan Wilmans 2013.
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
#include "Win32/Win32Lib.h"
#include "Win32/Com.h"
#include <Ole2.h>
namespace fusion {
namespace Win32 {
ComInitialization::ComInitialization()
{
// OleInitialize/OleUninitialize is used instead of CoInitializeEx/CoUninitialize because it is required for use of IDropTarget's Drag and Drop functions
HRESULT hr = OleInitialize(nullptr);
if (FAILED(hr))
{
throw Win32Error(hr, "OleInitialize");
}
}
ComInitialization::~ComInitialization()
{
OleUninitialize();
}
} // namespace Win32
} // namespace fusion