mirror of
https://github.com/Xevion/easy7zip.git
synced 2025-12-08 08:07:06 -06:00
4.44 beta
This commit is contained in:
committed by
Kornel Lesiński
parent
804edc5756
commit
d9666cf046
37
CPP/Windows/COM.cpp
Executable file
37
CPP/Windows/COM.cpp
Executable file
@@ -0,0 +1,37 @@
|
||||
// Windows/COM.cpp
|
||||
|
||||
#include "StdAfx.h"
|
||||
|
||||
#include "Windows/COM.h"
|
||||
#include "Common/StringConvert.h"
|
||||
|
||||
namespace NWindows {
|
||||
namespace NCOM {
|
||||
|
||||
// CoInitialize (NULL); must be called!
|
||||
|
||||
UString GUIDToStringW(REFGUID guid)
|
||||
{
|
||||
UString string;
|
||||
const int kStringSize = 48;
|
||||
StringFromGUID2(guid, string.GetBuffer(kStringSize), kStringSize);
|
||||
string.ReleaseBuffer();
|
||||
return string;
|
||||
}
|
||||
|
||||
AString GUIDToStringA(REFGUID guid)
|
||||
{
|
||||
return UnicodeStringToMultiByte(GUIDToStringW(guid));
|
||||
}
|
||||
|
||||
HRESULT StringToGUIDW(const wchar_t *string, GUID &classID)
|
||||
{
|
||||
return CLSIDFromString((wchar_t *)string, &classID);
|
||||
}
|
||||
|
||||
HRESULT StringToGUIDA(const char *string, GUID &classID)
|
||||
{
|
||||
return StringToGUIDW(MultiByteToUnicodeString(string), classID);
|
||||
}
|
||||
|
||||
}}
|
||||
Reference in New Issue
Block a user