Hi
I use GUIDs in many of my programs.
Maybe someone could benefit from it.
I do it like this:
Inside Global Map:
MODULE('winapi')
CoCreateGuid(*?),UNSIGNED,PASCAL,RAW,DLL(1),NAME('CoCreateGuid')
StringFromGUID2(*?,*?,LONG cchMax),UNSIGNED,PASCAL,RAW,NAME('StringFromGUID2')
WideCharToMultiByte(UNSIGNED CodePage=0,USHORT dwFlags=0,*? lpWideCharStr,LONG cchWideChar,*? lpMultiByteStr,LONG cbMultiByte,? lpDefaultChar,BYTE lpUsedDefaultChar),UNSIGNED,PASCAL,RAW,NAME('WideCharToMultiByte')
END
GUID PROCEDURE(), STRING
pGuid STRING(16)
buf STRING(128)
buf2 STRING(64)
cbSize LONG
CODE
IF CoCreateGuid(pGUID)
RETURN(''
ELSE
IF StringFromGuid2(pGuid,buf,SIZE(buf)/2)
cbSize = WideCharToMultiByte(, , buf, -1, buf2, SIZE(buf2), 0,0)
IF cbSize > 0
buf2 = buf2[1 : cbSize]
RETURN(CLIP(buf2))
END
ELSE
RETURN('')
END
END
/Niels