It's just a GUID...don't be afraid...
Ever have one of those problems that just doesn't make any damned sense? And, have you ever looked at it and turned it over in your head until it just pisses you off?
Well, that's what I am now......just pissed off. The whole problem doesn't even make sense! Maybe I should tell you what it is before I continue ranting, huh?
I need to generate a GUID for identity purposes in some code. I wrote a small GUID class that works great (at work on a Win95b box - Visual Studio Enterprise sp3). At work, every GUID was RADICALLY different from the one before. Happily, I emailed the class to myself at home.
(This is where the pissed off part comes in...) I tried it at home, but I get GUIDS so close to one another that it is scary. I mean, look at these!
{C90D2637-BFFD-11D4-9A62-0020781D2FEA}*
{C90D2638-BFFD-11D4-9A62-0020781D2FEA}*
{C90D2639-BFFD-11D4-9A62-0020781D2FEA}*
{C90D263A-BFFD-11D4-9A62-0020781D2FEA}*
{C90D263B-BFFD-11D4-9A62-0020781D2FEA}*
{C90D263C-BFFD-11D4-9A62-0020781D2FEA}*
{C90D263D-BFFD-11D4-9A62-0020781D2FEA}*
Only positions 8 & 9 are changing! WHAT'S UP WITH THAT?!
At home I am using Win98se, Visual Studio Enterprise 6.0 with sp3. I have included the class below. Any help that you could give would be GREATLY appreciated...
beginning of class---------------------------
Option Explicit
Private Declare Function CoCreateGuid Lib "OLE32.DLL" (pGuid As GUID) As Long
Private Declare Function StringFromGUID2 Lib "OLE32.DLL" (pGuid As GUID, _
ByVal PointerToString As Long, _
ByVal MaxLength As Long) As Long
Private Type GUID
Guid1 As Long
Guid2 As Long
Guid3 As Long
Guid4(7) As Byte
End Type
Private m_strGUID As String
Public Sub GenerateGUID()
Dim udtGUID As GUID
Dim sGUID As String
Dim lResult As Long
lResult = CoCreateGuid(udtGUID)
If lResult Then
sGUID = ""
Else
sGUID = String$(38, 0)
StringFromGUID2 udtGUID, StrPtr(sGUID), 39
End If
m_strGUID = sGUID
End Sub
Public Property Get GUID() As String
GUID = m_strGUID
End Property
-------------------------------end of class
Thanks......
(Sorry about the ranting....but I feel bet....NO I DON'T! I'm still pissed, and I want to figure this crap out!!!)