Print a GUID variable

前端 未结 11 1892
孤城傲影
孤城傲影 2021-02-01 02:12

I have a GUID variable and I want to write inside a text file its value. GUID definition is:

typedef struct _GUID {          // size is 16
    DWORD Data1;
             


        
11条回答
  •  天命终不由人
    2021-02-01 02:28

    You can eliminate the need for special string allocations/deallocations by using StringFromGUID2()

    GUID guid = ;
    // note that OLECHAR is a typedef'd wchar_t
    wchar_t szGUID[64] = {0};
    StringFromGUID2(&guid, szGUID, 64);
    

提交回复
热议问题