/* Collection of code snippets by Arne Vajhøj */
/* (likely posted to comp.os.vms/INFO-VAX, INFO-TPU, MACRO32, eksperten.dk, newz.dk, LinkedIn or other place sometime between 1990 and now) */
#include <windows.h>
#include <objbase.h>
#include <stdio.h>

int main()
{
    GUID guid;
    unsigned char *p;
    int i;
    CoInitialize(NULL);
    if(CoCreateGuid(&guid) == S_OK) 
    {
        p = (unsigned char *)&guid;
        for(i=0;i<16;i++) printf("%02X",(int)p[i]);
        printf("\n");
    } 
    else
    {
        printf("oops\n");
    }
    CoUninitialize();
    return 0;
}
