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


Groups > comp.lang.clipper.visual-objects > #6465 > unrolled thread

Globally Unique Identifier

Started by"Jozo" <racunalo@os.t-com.hr>
First post2014-01-08 17:26 +0100
Last post2014-01-08 22:09 -0800
Articles 5 — 4 participants

Back to article view | Back to comp.lang.clipper.visual-objects


Contents

  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

#6465 — Globally Unique Identifier

From"Jozo" <racunalo@os.t-com.hr>
Date2014-01-08 17:26 +0100
SubjectGlobally Unique Identifier
Message-ID<laju7s$5c8$1@ls237.t-com.hr>
Does anyone has function or method for Globally Unique Identifier ?

Thanks in advance, Jozo. 

[toc] | [next] | [standalone]


#6466

FromKarl Faller <mail_withoutthat_@_drei-f_andthat_.de>
Date2014-01-08 20:00 +0100
Message-ID<nk6rc99i6ffio6e7ftkfugns81hkms67be@4ax.com>
In reply to#6465
Jozo, 
>Does anyone has function or method for Globally Unique Identifier ?
About a year ago you already asked and Willie wrote:
>>>>>>>>>>>>>
Jozo,
In order to create a GUID, you have to have the dll definition. That
is why 
you are getting an error message saying that the function in unknown.

Regards,
Willie
Vulcan VIP

_DLL FUNCTION CoCreateGuid( p AS _winGuid ) AS LONG 
PASCAL:OLE32.CoCreateGuid

(pls as a one liner!!)



"Jozo"  wrote in message news:kbffli$t8s$1@ls237.t-com.hr...

Hello all,

I have the function for creating UniqueKey for that the compiler
signalizes
next error:
"Entity CoCreateGuid is unkonwn, bad function call "
The problem is in next code:
hr := CoCreateGuid(@GUID_New)

Can somebody help me with correctly function or any correctly solution
?
I work with Vo27b 2740, Windows XP. Thanks in advance.

Jozo

Source of function:

FUNCTION CreateaUniqueKey  AS STRING PASCAL
LOCAL Guid_New IS _winGuid
LOCAL hr       AS LONG
LOCAL lpBuffer AS PSZ
LOCAL sGuid    AS STRING
hr := CoCreateGuid(@GUID_New)
lpBuffer:= MemAlloc(255)
hr := StringFromGUID2(  @Guid_new , lpBuffer, 255)
sGuid := Mem2String(lpBuffer, hr*2)    // Unicode: char = 2 bytes
MemFree(lpBuffer)
sGuid := Wide2Multi(sGuid)     // Undocumente in VO runtime
RETURN sGuid
<<<<<<<<<<<<<<<<<<<<

HTH
Karl

[toc] | [prev] | [next] | [standalone]


#6469

From"Jozo" <racunalo@os.t-com.hr>
Date2014-01-09 00:38 +0100
Message-ID<laknic$koc$1@ls237.t-com.hr>
In reply to#6466
Thanks both, Karl and Urs. You helped me a lot.

Jozo

"Karl Faller" <mail_withoutthat_@_drei-f_andthat_.de> wrote in message 
news:nk6rc99i6ffio6e7ftkfugns81hkms67be@4ax.com...
> Jozo,
>>Does anyone has function or method for Globally Unique Identifier ?
> About a year ago you already asked and Willie wrote:
>>>>>>>>>>>>>>
> Jozo,
> In order to create a GUID, you have to have the dll definition. That
> is why
> you are getting an error message saying that the function in unknown.
>
> Regards,
> Willie
> Vulcan VIP
>
> _DLL FUNCTION CoCreateGuid( p AS _winGuid ) AS LONG
> PASCAL:OLE32.CoCreateGuid
>
> (pls as a one liner!!)
>
>
>
> "Jozo"  wrote in message news:kbffli$t8s$1@ls237.t-com.hr...
>
> Hello all,
>
> I have the function for creating UniqueKey for that the compiler
> signalizes
> next error:
> "Entity CoCreateGuid is unkonwn, bad function call "
> The problem is in next code:
> hr := CoCreateGuid(@GUID_New)
>
> Can somebody help me with correctly function or any correctly solution
> ?
> I work with Vo27b 2740, Windows XP. Thanks in advance.
>
> Jozo
>
> Source of function:
>
> FUNCTION CreateaUniqueKey  AS STRING PASCAL
> LOCAL Guid_New IS _winGuid
> LOCAL hr       AS LONG
> LOCAL lpBuffer AS PSZ
> LOCAL sGuid    AS STRING
> hr := CoCreateGuid(@GUID_New)
> lpBuffer:= MemAlloc(255)
> hr := StringFromGUID2(  @Guid_new , lpBuffer, 255)
> sGuid := Mem2String(lpBuffer, hr*2)    // Unicode: char = 2 bytes
> MemFree(lpBuffer)
> sGuid := Wide2Multi(sGuid)     // Undocumente in VO runtime
> RETURN sGuid
> <<<<<<<<<<<<<<<<<<<<
>
> HTH
> Karl
> 

[toc] | [prev] | [next] | [standalone]


#6467

From"Urs Eggmann" <Urs.Eggmann@shinternet.ch>
Date2014-01-08 22:30 +0100
Message-ID<bj5v9rFfu36U1@mid.individual.net>
In reply to#6465
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.
> 

[toc] | [prev] | [next] | [standalone]


#6471

FromMathias <mathias.hakansson@consultec.se>
Date2014-01-08 22:09 -0800
Message-ID<5900b6f6-fd3b-44c3-82d8-5b60286f82a4@googlegroups.com>
In reply to#6467
Fabrice Foray also has functions for this in his libs.

/Mathias

Den onsdagen den 8:e januari 2014 kl. 22:30:52 UTC+1 skrev Urs Eggmann:
> 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.
> 
> >

[toc] | [prev] | [standalone]


Back to top | Article view | comp.lang.clipper.visual-objects


csiph-web