Blender V4.3
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
28namespace blender {
30 HRESULT _hr;
31
32 public:
34 {
35 _hr = CoInitializeEx(nullptr, flags);
36 }
38 {
39 if (SUCCEEDED(_hr)) {
40 CoUninitialize();
41 }
42 }
43 operator HRESULT()
44 {
45 return _hr;
46 }
47};
48} // namespace blender