Browse Source

Fix for uuidtostring function.

tags/2021-05-28
jules 13 years ago
parent
commit
6a67ab2eb2
1 changed files with 10 additions and 4 deletions
  1. +10
    -4
      modules/juce_core/native/juce_win32_ComSmartPtr.h

+ 10
- 4
modules/juce_core/native/juce_win32_ComSmartPtr.h View File

@@ -31,11 +31,17 @@ template<typename Type> struct UUIDGetter { static CLSID get() { jassertfalse; r
#define __uuidof(x) UUIDGetter<x>::get()
#endif
inline CLSID uuidFromString (const char* s) noexcept
inline GUID uuidFromString (const char* const s) noexcept
{
CLSID c;
UuidFromStringA ((unsigned char*) s, &c);
return c;
unsigned long p0;
unsigned int p1, p2, p3, p4, p5, p6, p7, p8, p9, p10;
sscanf_s (s, "%08lX-%04X-%04X-%02X%02X-%02X%02X%02X%02X%02X%02X",
&p0, &p1, &p2, &p3, &p4, &p5, &p6, &p7, &p8, &p9, &p10);
GUID g = { p0, (uint16) p1, (uint16) p2, { (uint8) p3, (uint8) p4, (uint8) p5, (uint8) p6,
(uint8) p7, (uint8) p8, (uint8) p9, (uint8) p10 }};
return g;
}
//==============================================================================


Loading…
Cancel
Save