Jump to content

_GenerateGUID()


Zinthose
 Share

Recommended Posts

Using the "Scriptlet.TypeLib" COM object you can easily generate a GUID for whatever use you can imagine.

I went a tad overboard and added the official documentation for the sake of practice. :P

#Include File - GenGUID.au3

#include-Once

; #INDEX# =======================================================================================================================
; Title .........: GenGUID
; AutoIt Version : 3.2.10++
; Language ......: English
; Description ...: This module contains a function to generate a GUID string.
; ===============================================================================================================================

; #NO_DOC_FUNCTION# =============================================================================================================
; Not documented - function(s) no longer needed, will be worked out of the file at a later date
; ===============================================================================================================================
; ===============================================================================================================================

; #CURRENT# =====================================================================================================================
;_GenerateGUID
; ===============================================================================================================================

; #INTERNAL_USE_ONLY#============================================================================================================
; ===============================================================================================================================

; #FUNCTION# ====================================================================================================================
; Name...........: _GenerateGUID
; Description ...: Genterates a GUID string.
; Syntax.........: _GenerateGUID()
; Parameters ....:
; Return values .: Success - String 
;                  Failure - -1, sets @error to 1
; Author ........: Dane Robert Jones <danerjones at gmail dot com>
; Modified.......:
; Remarks .......: Uses the "Scriptlet.TypeLib" COM object.
; Related .......:
; Link ..........;
; Example .......; Yes
; ===============================================================================================================================

Func _GenerateGUID()
    Local $TypeLib = ObjCreate("Scriptlet.TypeLib")
    
    If IsObj($TypeLib) Then
        Return $TypeLib.Guid
    Else
        SetError(1)
        Return -1
    EndIf

EndFunc   ;==>_GenerateGUIDoÝ÷ Úȳz쥩ì·)^
Edited by Zinthose

--- TTFN

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...