|
-
Nov 21st, 2000, 11:36 PM
#1
Thread Starter
Junior Member
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!!!)
-
Nov 22nd, 2000, 02:00 AM
#2
Do you have a netword card in your machine at home? THe GUID uses the MAC address on the network card to seed itself. If you don't have a network card, then it seeds some other way that may be producing the results you are getting.
Look on the bright side - at leaset the numbers are different, even if only by a little bit.
- gaffa
-
Nov 22nd, 2000, 02:39 AM
#3
Thread Starter
Junior Member
Yeah, I got a card....in fact, I've got 2. This box is also the gateway to my home network through my DSL connection.
The bright side.....hmmmmm... This application specifically deals with security issues. Failure or a breach in it's security is not an option. (Well, it is an option, technically speaking. Only the software would have no market, and my name would be mud for putting it out.)
I'm thinking of just using a "random" number generator to randomly generate my own little keys. They don't have to be globally unique (I guess), the probability of you finding a key AND finding the machine that will respond to it must be very, very remote.
Thanks for the input....
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|