aboutsummaryrefslogtreecommitdiff
path: root/CPP/Common/MyInitGuid.h
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--CPP/Common/MyInitGuid.h49
1 files changed, 49 insertions, 0 deletions
diff --git a/CPP/Common/MyInitGuid.h b/CPP/Common/MyInitGuid.h
new file mode 100644
index 0000000..04d77e2
--- /dev/null
+++ b/CPP/Common/MyInitGuid.h
@@ -0,0 +1,49 @@
1// Common/MyInitGuid.h
2
3#ifndef __COMMON_MY_INITGUID_H
4#define __COMMON_MY_INITGUID_H
5
6/*
7This file must be included only to one C++ file in project before
8declarations of COM interfaces with DEFINE_GUID macro.
9
10Each GUID must be initialized exactly once in project.
11There are two different versions of the DEFINE_GUID macro in guiddef.h (MyGuidDef.h):
12 - if INITGUID is not defined: DEFINE_GUID declares an external reference to the symbol name.
13 - if INITGUID is defined: DEFINE_GUID initializes the symbol name to the value of the GUID.
14
15Also we need IID_IUnknown that is initialized in some file for linking:
16 MSVC: by default the linker uses some lib file that contains IID_IUnknown
17 MinGW: add -luuid switch for linker
18 WinCE: we define IID_IUnknown in this file
19 Other: we define IID_IUnknown in this file
20*/
21
22#ifdef __clang__
23 #pragma clang diagnostic ignored "-Wmissing-variable-declarations"
24#endif
25
26#ifdef _WIN32
27
28#ifdef UNDER_CE
29#include <basetyps.h>
30#endif
31
32#include <InitGuid.h>
33
34#ifdef UNDER_CE
35DEFINE_GUID(IID_IUnknown,
360x00000000, 0x0000, 0x0000, 0xC0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46);
37#endif
38
39#else
40
41#define INITGUID
42#include "MyGuidDef.h"
43DEFINE_GUID(IID_IUnknown,
440x00000000, 0x0000, 0x0000, 0xC0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46);
45
46#endif
47
48
49#endif