Blender
V4.3
source
blender
blenlib
BLI_winstuff_com.hh
Go to the documentation of this file.
1
/* SPDX-FileCopyrightText: 2022 Blender Authors
2
*
3
* SPDX-License-Identifier: GPL-2.0-or-later */
4
5
#pragma once
6
12
#ifndef _WIN32
13
# error "This include is for Windows only!"
14
#endif
15
16
#include "
BLI_sys_types.h
"
17
18
#define WIN32_LEAN_AND_MEAN
19
20
#ifndef NOMINMAX
21
# define NOMINMAX
22
# include <
windows.h
>
23
# undef NOMINMAX
24
#else
25
# include <
windows.h
>
26
#endif
27
28
namespace
blender
{
29
class
CoInitializeWrapper
{
30
HRESULT _hr;
31
32
public
:
33
CoInitializeWrapper
(DWORD flags)
34
{
35
_hr = CoInitializeEx(
nullptr
, flags);
36
}
37
~CoInitializeWrapper
()
38
{
39
if
(SUCCEEDED(_hr)) {
40
CoUninitialize();
41
}
42
}
43
operator
HRESULT()
44
{
45
return
_hr;
46
}
47
};
48
}
// namespace blender
BLI_sys_types.h
blender::CoInitializeWrapper
Definition
BLI_winstuff_com.hh:29
blender::CoInitializeWrapper::CoInitializeWrapper
CoInitializeWrapper(DWORD flags)
Definition
BLI_winstuff_com.hh:33
blender::CoInitializeWrapper::~CoInitializeWrapper
~CoInitializeWrapper()
Definition
BLI_winstuff_com.hh:37
blender
Definition
ANIM_action.hh:36
windows.h
Generated on Thu Feb 6 2025 07:36:39 for Blender by
doxygen
1.11.0