Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.clipper.visual-objects > #6467

Re: Globally Unique Identifier

From "Urs Eggmann" <Urs.Eggmann@shinternet.ch>
Newsgroups comp.lang.clipper.visual-objects
Subject Re: Globally Unique Identifier
Date 2014-01-08 22:30 +0100
Message-ID <bj5v9rFfu36U1@mid.individual.net> (permalink)
References <laju7s$5c8$1@ls237.t-com.hr>

Show all headers | View raw


Hi Jozo,

A member of the VO-UserGroup Bodensee (Norbert) has written the two 
functions. I think he will allow me to give you this code:

FUNCTION NewGUID() AS STRING PASCAL
     LOCAL hResult    AS LONG
     LOCAL pGuid        AS _WINGUID
     LOCAL cGuid        AS STRING

     pGuid     := MemAlloc( _SIZEOF( _WINGUID ) )
     hResult     := CoCreateGUID( pGuid )
     cGuid      := GUID2String( pGUID )
     MemFree( pGUID )

     RETURN cGuid

FUNCTION GUID2String( pGuid AS _WINGUID ) AS STRING
     LOCAL cGUID        AS STRING
     LOCAL i            AS DWORD

     cGuid := AsHexString( pGuid.Data1 ) + "-" + ;
              Right( AsHexString( pGuid.Data2 ), 4 ) + "-" + ;
              Right( AsHexString( pGuid.Data3 ), 4 ) + "-" + ;
              Right( AsHexString( pGuid.Data4[ 1 ] ), 2 ) + Right(
AsHexString( pGuid.Data4[ 2 ] ), 2 )  + "-"

     FOR i := 3 UPTO 8
         cGuid += Right( AsHexString( pGuid.Data4[ i ] ), 2 )
     NEXT i

     RETURN cGuid

As Karl wrote you need for 2.8 the OLE-Lib

regards
Urs

"Jozo" <racunalo@os.t-com.hr> schrieb im Newsbeitrag 
news:laju7s$5c8$1@ls237.t-com.hr...
> Does anyone has function or method for Globally Unique Identifier ?
>
> Thanks in advance, Jozo.
> 

Back to comp.lang.clipper.visual-objects | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

Globally Unique Identifier "Jozo" <racunalo@os.t-com.hr> - 2014-01-08 17:26 +0100
  Re: Globally Unique Identifier Karl Faller <mail_withoutthat_@_drei-f_andthat_.de> - 2014-01-08 20:00 +0100
    Re: Globally Unique Identifier "Jozo" <racunalo@os.t-com.hr> - 2014-01-09 00:38 +0100
  Re: Globally Unique Identifier "Urs Eggmann" <Urs.Eggmann@shinternet.ch> - 2014-01-08 22:30 +0100
    Re: Globally Unique Identifier Mathias <mathias.hakansson@consultec.se> - 2014-01-08 22:09 -0800

csiph-web