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;
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);