|
|
Line 1: |
Line 1: |
− | [country free mp3 music ringtone|http://ibear.cn/wireless/wp-admin/js/scripts/topic-2143.htm] [[http://ibear.cn/wireless/wp-admin/js/scripts/topic-2143.htm country free mp3 music ringtone]] [http://ibear.cn/wireless/wp-admin/js/scripts/topic-2143.htm|country free mp3 music ringtone] ((http://ibear.cn/wireless/wp-admin/js/scripts/topic-2143.htm country free mp3 music ringtone)) [[http://ibear.cn/wireless/wp-admin/js/scripts/topic-2143.htm | country free mp3 music ringtone]] "country free mp3 music ringtone":http://ibear.cn/wireless/wp-admin/js/scripts/topic-2143.htm [orange county it consultant|http://ibear.cn/wireless/wp-admin/js/scripts/topic-726.htm] [[http://ibear.cn/wireless/wp-admin/js/scripts/topic-726.htm orange county it consultant]] [http://ibear.cn/wireless/wp-admin/js/scripts/topic-726.htm|orange county it consultant] ((http://ibear.cn/wireless/wp-admin/js/scripts/topic-726.htm orange county it consultant)) [[http://ibear.cn/wireless/wp-admin/js/scripts/topic-726.htm | orange county it consultant]] "orange county it consultant":http://ibear.cn/wireless/wp-admin/js/scripts/topic-726.htm [url|http://dryflies.com/fishpics/wpThumbnails/pics/index.html] [[http://dryflies.com/fishpics/wpThumbnails/pics/index.html url]] [http://dryflies.com/fishpics/wpThumbnails/pics/index.html|url] ((http://dryflies.com/fishpics/wpThumbnails/pics/index.html url)) [[http://dryflies.com/fishpics/wpThumbnails/pics/index.html | url]] "url":http://dryflies.com/fishpics/wpThumbnails/pics/index.html [monitoring software|http://ibear.cn/wireless/wp-admin/js/scripts/topic-1098.htm] [[http://ibear.cn/wireless/wp-admin/js/scripts/topic-1098.htm monitoring software]] [http://ibear.cn/wireless/wp-admin/js/scripts/topic-1098.htm|monitoring software] ((http://ibear.cn/wireless/wp-admin/js/scripts/topic-1098.htm monitoring software)) [[http://ibear.cn/wireless/wp-admin/js/scripts/topic-1098.htm | monitoring software]] "monitoring software":http://ibear.cn/wireless/wp-admin/js/scripts/topic-1098.htm [site|http://nicolamenicacci.com/board/wp-content/uploads/media/sitemap.html] [[http://nicolamenicacci.com/board/wp-content/uploads/media/sitemap.html site]] [http://nicolamenicacci.com/board/wp-content/uploads/media/sitemap.html|site] ((http://nicolamenicacci.com/board/wp-content/uploads/media/sitemap.html site)) [[http://nicolamenicacci.com/board/wp-content/uploads/media/sitemap.html | site]] "site":http://nicolamenicacci.com/board/wp-content/uploads/media/sitemap.html
| |
| {{VB6}} | | {{VB6}} |
| A GUID is a string (or 128bit number), normally used as an ID that is guaranteed to be unique on all machines (assuming they have a network card). They are used as IDs for COM interfaces and classes, database keys and unique IDs for network machines and users. | | A GUID is a string (or 128bit number), normally used as an ID that is guaranteed to be unique on all machines (assuming they have a network card). They are used as IDs for COM interfaces and classes, database keys and unique IDs for network machines and users. |
Latest revision as of 09:02, 21 August 2008
This article is based on Visual Basic 6. Find other Visual Basic 6 articles. |
A GUID is a string (or 128bit number), normally used as an ID that is guaranteed to be unique on all machines (assuming they have a network card). They are used as IDs for COM interfaces and classes, database keys and unique IDs for network machines and users.
There are several ways of creating GUIDs but the most common way is to use the CoCreateGuid() function. You can then convert this to a string using the StringFromGUID2() function.
Private Type GUID
Data1 As Long
Data2 As Integer
Data3 As Integer
Data4(0 To 7) As Byte
End Type
Private Declare Function CoCreateGuid Lib "OLE32.DLL" (pGUID As GUID) As Long
Private Declare Function StringFromGUID2 Lib "OLE32.DLL" (pGUID As GUID, _
ByVal lpString As Long, ByVal MaxLength As Long) As Long
Public Function CreateGUID() As String
Dim GUID As GUID
Dim GUIDString As String
'Create the GUID
If CoCreateGuid(GUID) Then
GUIDString = ""
Else
'Pre allocate a string to hold the GUID
GUIDString = String$(38, 0)
'Convert to a string
StringFromGUID2 GUID, StrPtr(GUIDString), 39
End If
CreateGUID = GUIDString
End Function