Post date: Nov 25, 2015 8:10:38 AM
Would think that something like this is easily found, took over 1/2 day to find this posting.
http://stackoverflow.com/questions/21431047/how-to-convert-guid-to-char
The code is
#include <Windows.h>
char* IdToString(const GUID* id, char* out)
{
int i;
char* ret = out;
out += sprintf(out, "{");
out += sprintf(out, "%.8lX-%.4hX-%.4hX-", id->Data1, id->Data2, id->Data3);
for (i = 0; i < sizeof(id->Data4); ++i)
{
out += sprintf(out, "%.2hhX", id->Data4[i]);
if (i == 1) *(out++) = '-';
}
out += sprintf(out, "}");
return ret;
}
to call,
UUID xuid;
char buffer[39];
and
std::cout << IdToString(&xuid, buffer) << std::endl;