UUID Introduction: http://baike.baidu.com/view/1052579.htm
Introduction to guid: http://baike.baidu.com/view/185358.htm
# Include <stdio. h>
/* Method 1: header files and libraries */
# Include <rpc. h>
# Pragma Comment (Lib, "rpcrt4.lib ")
Int Main ( Void )
{
/* Method 1 */
UUID myuuid;
Uuidcreate (& myuuid );
Unsigned Char * Struuid;
Uuidtostringa (& myuuid, & struuid );
Printf ( " % S \ n " , Struuid );
/* Method 2 */
: Coinitialize (null );
Guid myguid;
: Cocreateguid (& myguid );
Printf ( " % 08x-% 04x-% 04x-% 02x % 02x-% 02x % 02x % 02x % 02x % 02x % 02x % 02x \ n " , Myguid. data1, myguid. data2, myguid. data3, myguid. data4 [ 0 ], Myguid. data4 [ 1 ], Myguid. data4 [ 1 ], Myguid. data4 [ 2 ],
Myguid. data4 [ 3 ], Myguid. data4 [ 4 ], Myguid. data4 [ 5 ], Myguid. data4 [ 6 ], Myguid. data4 [ 7 ]);
: Couninitialize (); // Remember to release
Return 0 ;
}