我正在尝试初始化一个GUID变量,但我不确定这就是你要这样做的方式。我特别困惑的是如何将最后 12 个十六进制数字存储在 char 数组中(我是否包含“-”字符?)
如何定义/初始化 GUID 变量?
bool TVManager::isMonitorDevice(GUID id)
{
// Class GUID for a Monitor is: {4d36e96e-e325-11ce-bfc1-08002be10318}
GUID monitorClassGuid;
char* a = "bfc1-08002be10318"; // do I store the "-" character?
monitorClassGuid.Data1 = 0x4d36e96e;
monitorClassGuid.Data2 = 0xe325;
monitorClassGuid.Data3 = 0x11ce;
monitorClassGuid.Data4 = a;
return (bool(id == monitorClassGuid));
}