How to get GUID

Hi All,
How do i get the current GUID ?
i need to get the GUID, format it in a string and then display it.
[124 byte] By [Ekalavya] at [2007-11-19 19:40:38]
# 1 Re: How to get GUID
CoCreateGuid
DragForce at 2007-11-10 23:43:11 >
# 2 Re: How to get GUID
Hi All,
How do i get the current GUID ?
i need to get the GUID, format it in a string and then display it.
Read this : GUID / MAC Address -- UuidCreate (http://groups.google.co.in/group/microsoft.public.vc.mfc/browse_thread/thread/1367bd2d68439f35/f47925c90e56e6db%23f47925c90e56e6db?sa=X&oi=groupsr&start=1&num=3) more info about UuidCreate... :)
jayender.vs at 2007-11-10 23:44:10 >
# 3 Re: How to get GUID
How do i get the current GUID ?
Do you want to generate a new GUID or obtain an object's GUID ?
Sahir at 2007-11-10 23:45:15 >
# 4 Re: How to get GUID
I want to create a new GUID and display it
Ekalavya at 2007-11-10 23:46:17 >
# 5 Re: How to get GUID
This should work

GUID Guid;
CoCreateGuid(&Guid);
RPC_WSTR str;
UuidToString((UUID*)&Guid, &str);
CString unique((LPTSTR)str);
AfxMessageBox(unique);
kolkoo at 2007-11-10 23:47:16 >