Hi Dave,

Thanks for that, it's the same as the one Stephen pointed me to and is the
one I will use.

Regards

John

John Weller
01380 723235
07976 393631

> -----Original Message-----
> From: ProfoxTech [mailto:[email protected]] On Behalf Of
> Dave Crozier
> Sent: 15 March 2013 13:29
> To: [email protected]
> Subject: RE: Password Security
> 
> A guid generator here, no idea where I got it from though and it may even
be
> the one on n2n.
> 
> Dave
> 
> * Generate GUID in VFP
> clear
> 
> DO declare
> 
>  LOCAL cGUID, cGUIDString, cGUID1
> cGUID = REPLICATE(CHR(0), 16)  && 128 bits
> 
> IF CoCreateGuid(@cGUID) = 0
>     cGUIDString = StringFromGUID(cGUID)
>     ? cGUID
>     ? cGUIDString
> 
>     * converting from String back to GUID
>     cGUID1 = REPLICATE(CHR(0), 16)
>     = CLSIDFromString(STRCONV(cGUIDString,5), @cGUID1)
>     ? cGUID1
> ENDIF
> * end of main
>  return
> 
> FUNCTION StringFromGUID(cGUID)
>     LOCAL cBuffer, nBufsize
>     nBufsize=128
>     cBuffer = REPLICATE(CHR(0), nBufsize*2)
>     = StringFromGUID2(cGUID, @cBuffer, nBufsize)
>     cBuffer = SUBSTR(cBuffer, 1, AT(CHR(0)+CHR(0), cBuffer)) RETURN
> STRCONV(cBuffer, 6)
> 
> PROCEDURE declare
>     DECLARE INTEGER CoCreateGuid IN ole32 STRING @pguid
> 
>     DECLARE INTEGER CLSIDFromString IN ole32;
>         STRING lpsz, STRING @pclsid
> 
>     DECLARE INTEGER StringFromGUID2 IN ole32;
>         STRING rguid, STRING @lpsz, INTEGER cchMax
> 
> 
[excessive quoting removed by server]

_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://mail.leafe.com/mailman/listinfo/profox
OT-free version of this list: http://mail.leafe.com/mailman/listinfo/profoxtech
Searchable Archive: http://leafe.com/archives/search/profox
This message: 
http://leafe.com/archives/byMID/profox/[email protected]
** All postings, unless explicitly stated otherwise, are the opinions of the 
author, and do not constitute legal or medical advice. This statement is added 
to the messages for those lawyers who are too stupid to see the obvious.

Reply via email to