diff options
author | Igor Pavlov <87184205+ip7z@users.noreply.github.com> | 2021-12-27 00:00:00 +0000 |
---|---|---|
committer | Igor Pavlov <87184205+ip7z@users.noreply.github.com> | 2022-03-18 15:35:13 +0500 |
commit | f19f813537c7aea1c20749c914e756b54a9c3cf5 (patch) | |
tree | 816ba62ca7c0fa19f2eb46d9e9d6f7dd7c3a744d /CPP/Windows/COM.cpp | |
parent | 98e06a519b63b81986abe76d28887f6984a7732b (diff) | |
download | 7zip-21.07.tar.gz 7zip-21.07.tar.bz2 7zip-21.07.zip |
'21.07'21.07
Diffstat (limited to 'CPP/Windows/COM.cpp')
-rw-r--r-- | CPP/Windows/COM.cpp | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/CPP/Windows/COM.cpp b/CPP/Windows/COM.cpp new file mode 100644 index 0000000..d0cb321 --- /dev/null +++ b/CPP/Windows/COM.cpp | |||
@@ -0,0 +1,41 @@ | |||
1 | // Windows/COM.cpp | ||
2 | |||
3 | #include "StdAfx.h" | ||
4 | |||
5 | /* | ||
6 | |||
7 | #include "COM.h" | ||
8 | #include "../Common/StringConvert.h" | ||
9 | |||
10 | namespace NWindows { | ||
11 | namespace NCOM { | ||
12 | |||
13 | // CoInitialize (NULL); must be called! | ||
14 | |||
15 | UString GUIDToStringW(REFGUID guid) | ||
16 | { | ||
17 | UString s; | ||
18 | const unsigned kSize = 48; | ||
19 | StringFromGUID2(guid, s.GetBuf(kSize), kSize); | ||
20 | s.ReleaseBuf_CalcLen(kSize); | ||
21 | return s; | ||
22 | } | ||
23 | |||
24 | AString GUIDToStringA(REFGUID guid) | ||
25 | { | ||
26 | return UnicodeStringToMultiByte(GUIDToStringW(guid)); | ||
27 | } | ||
28 | |||
29 | HRESULT StringToGUIDW(const wchar_t *string, GUID &classID) | ||
30 | { | ||
31 | return CLSIDFromString((wchar_t *)string, &classID); | ||
32 | } | ||
33 | |||
34 | HRESULT StringToGUIDA(const char *string, GUID &classID) | ||
35 | { | ||
36 | return StringToGUIDW(MultiByteToUnicodeString(string), classID); | ||
37 | } | ||
38 | |||
39 | }} | ||
40 | |||
41 | */ | ||