Jump to content
Sign in to follow this  
Zinthose

_GenerateGUID()

Recommended Posts

Zinthose

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

Share this post


Link to post
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
Sign in to follow this  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.