|
|||||||||||
|
COM [an error occurred while processing this directive] Topics 1. How do I generate a GUID on a PocketPC? 1. How do I generate a GUID on a PocketPC? I don't think there is a function to create a GUID either, so I wrote a simple function that creates a GUID string. This function conforms to standard methods for generating a GUID (based on documentation I was able to find). The function puts the GUID in a VARIANT bstring.... BOOL CreateGuid(_variant_t *lValue) { TCHAR wGuid[37]; SYSTEMTIME systime; FILETIME filetime; // construct GUID GetSystemTime(&systime); SystemTimeToFileTime(&systime,&filetime); DWORD tick=GetTickCount(); DWORD highWord=filetime.dwHighDateTime+0x146BF4; // convert GUID to a string wsprintf(wGuid,TEXT("%08.8x-%04.4x-%04.4x-%04.4x-%04.4x%04.4x%04.4x"), filetime.dwLowDateTime, LOWORD(highWord), HIWORD(highWord |0x10000000), LOWORD(rand()), HIWORD(tick), LOWORD(tick), LOWORD(rand())); *lValue=wGuid; return TRUE; } For more information: http://www.IdeaCon.com Credits: Andrew Wingers ( www.IdeaCon.com ) [an error occurred while processing this directive] Terence Goggin's DoctorCE.com site - Custom Windows CE development/consulting services. Return to Chris De Herrera's Windows CE Website Questions? Comments? Suggestions? Email Terence "Dr. CE" Goggin. |