Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
GUID
Message
De
08/08/2001 07:59:34
Cetin Basoz
Engineerica Inc.
Izmir, Turquie
 
 
À
08/08/2001 07:35:22
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivie
Information générale
Forum:
Visual FoxPro
Catégorie:
Fonctions Windows API
Titre:
Re: GUID
Divers
Thread ID:
00541165
Message ID:
00541174
Vues:
30
This message has been marked as the solution to the initial question of the thread.
>How do I get a GUID (Globally Uniqued ID)?
>
>(Probably I should check the API manuals, but this sort of programming is quite new for me!)
>
>I am writing a text on primary keys, and I understand that some programmers prefer to use GUIDs, so I have to include a discussion of GUIDs, for completeness sake.

Hilmar,
I don't remember who to credit for this (not my code) :
*** Run this once at the beginning of your app (in your MAIN.PRG)

DECLARE INTEGER CoCreateGuid ;
  IN Ole32.dll ;
  STRING @lcGUIDStruc
DECLARE INTEGER StringFromGUID2 ;
  IN Ole32.dll ;
  STRING cGUIDStruc, ;
  STRING @cGUID, ;
  LONG nSize

*** Run this as required.

PROCEDURE GetGUID
cStrucGUID=SPACE(16)
cGUID=SPACE(80)
nSize=40
IF CoCreateGuid(@cStrucGUID) # 0
   RETURN ""
ENDIF
IF StringFromGUID2(cStrucGUID,@cGuid,nSize) = 0
  RETURN ""
ENDIF
RETURN STRCONV(LEFT(cGUID,76),6)
ENDPROC
Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform