I am working with Win32 API in C and have a need to convert a GUID structure into LPCSTR. I am relatively new to Win32 and didn't find much information around this type of conversion.
I did manage to convert GUID to OLECHAR using StringFromGUID2 function (see code fragment below) but stuck on further conversion to LPSCSTR. I am not too sure I am heading in the correct direction with OLECHAR but at the moment it seems logical thing to do.
GUID guid;
OLECHAR wszGuid[40] = {0};
OLECHAR szGuid[40]={0};
LPCSTR lpcGuid;
CoCreateGuid(&guid);
StringFromGUID2(&guid, wszGuid, _countof(wszGuid));