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;
I know the question is quite old, but would this work maybe?
inline std::ostream& operator <<(std::ostream& ss,GUID const& item) { OLECHAR* bstrGuid; ::StringFromCLSID(item, &bstrGuid); ss << bstrGuid; ::CoTaskMemFree(bstrGuid); return ss; }