Jump to content

XML config file


eltorro
 Share

Recommended Posts

Here is a very basic XML reader/writer. It is primarily intended for configuration files but is not limited to such.

It has functions similar to RegRead and RegWrite.

It does not support name spaces or attributes presently. (simple api ^_^ )

Syntax is pretty simple:

#include <_ConfigIO.au3>
Local $vRet

;create an config file with default settings and open it.
Local $Fh = _Config_Create(@ScriptDir&"\config.xml",1)

;write a setting
_Config_Write($Fh,"Application","ScriptPath",@ScriptFullPath)

;read a setting
$vRet =_Config_Read($Fh,"Application","ScriptPath")
If Not @error Then MsgBox(0,"ScriptPath",$vRet)

;Save it.
_Config_Save($Fh)

;close to release it.
_Config_Close($Fh)

Here is a list of functions:

  • _Config_Create
  • _Config_Open
  • _Config_Write
  • _Config_Read
  • _Config_EnumParam
  • _Config_EnumVal
  • _Config_Delete
  • _Config_Save
  • _Config_SaveAs
  • _Config_Close
  • _Config_Indent * Apparently need msxml4 or higher.
  • _Config_Base64_Encode * Needs AutoIt 3.3.X.
  • _Config_Base64_Decode * Needs AutoIt 3.3.X.
The UDF file:

_ConfigIO.au3

A chm file with examples:

_Config.chm

Edit:

Changed the example above to create the xml file

Added a check in the _Config_Indent function for object creation.

Edit:

Removed extra console output, checked for undeclared vars, updated docs.

Edited by eltorro
Link to comment
Share on other sites

chm isn't empty its a problem of XP SP2 and IE7 restrictions ... can be fixed, but would have to google to tell you how.

$a=StringSplit("547275737420796F757220546563686E6F6C75737421","")
For $b=1 To UBound($a)+(-1*-1*-1)step(2^4/8);&$b+=1*2/40*µ&Asc(4)
Assign("c",Eval("c")&Chr(Dec($a[$b]&$a[$b+1])));''Chr("a")&"HI"
Next ;time_U&r34d,ths,U-may=get$the&c.l.u.e;b3st-regards,JRSmile;
MsgBox(0x000000,"",Eval("c"));PiEs:d0nt+*b3.s4d.4ft3r.1st-try:-)
Link to comment
Share on other sites

Brilliant UDF eltorro - thanks a lot for the completeness of it (as in nicely packaged and executed project!) and the included CHM file, makes it so much easier to actually take into use.

For people having 'missing content' in CHM file as described by enaiman above - simply uncheck the "Always ask before opening this file" checkbox that Windows post-SP2 comes up with on newly downloaded executable files; solves the problem for me.

Edited by Sunaj
Link to comment
Share on other sites

Hey eltorro, this thing is great. When I read your down-played description I thought it would be a lot more basic than it actually is. The attributes feature would definitely be a plus but it's completely functional as-is. I'll be using it from here on out.

I might be missing some required Microsoft gizmos but I got an error trying to use the indent feature with a UTF-8 file.

_ConfigIO.au3 (441) : ==> Variable must be of type "Object".:
$oWriter.indent = True
$oWriter^ ERROR

According to your help-file the indent feature is still a little shoddy so I wasn't crying in my beer over it.

I also received an error in the EnumParam example letting me know that the third param was "Not Found". Was that intentional for the demo? From what I can tell the example only defines the app/desk-width and app/desk-height values but the loop is from 1-3 .

Well thanks for sharing, man! Hopefully I can return the favor with an XML-INI editor.

Link to comment
Share on other sites

Thanks for sharing! ^_^

Make sure brain is in gear before opening mouth!
Remember, what is not said, can be just as important as what is said.

Spoiler

What is the Secret Key? Life is like a Donut

If I put effort into communication, I expect you to read properly & fully, or just not comment.
Ignoring those who try to divert conversation with irrelevancies.
If I'm intent on insulting you or being rude, I will be obvious, not ambiguous about it.
I'm only big and bad, to those who have an over-active imagination.

I may have the Artistic Liesense ;) to disagree with you. TheSaint's Toolbox (be advised many downloads are not working due to ISP screwup with my storage)

userbar.png

Link to comment
Share on other sites

Hey eltorro, this thing is great. When I read your down-played description I thought it would be a lot more basic than it actually is. The attributes feature would definitely be a plus but it's completely functional as-is. I'll be using it from here on out.

I might be missing some required Microsoft gizmos but I got an error trying to use the indent feature with a UTF-8 file.

_ConfigIO.au3 (441) : ==> Variable must be of type "Object".:
$oWriter.indent = True
$oWriter^ ERROR

According to your help-file the indent feature is still a little shoddy so I wasn't crying in my beer over it.

I also received an error in the EnumParam example letting me know that the third param was "Not Found". Was that intentional for the demo? From what I can tell the example only defines the app/desk-width and app/desk-height values but the loop is from 1-3 .

Well thanks for sharing, man! Hopefully I can return the favor with an XML-INI editor.

Thanks for the positive comments ^_^

That error would seem to indicate that AutoIt was not able to create the object MSXML2.MXXMLWriter.4.0 which could mean that you do not have MSXML4 installed. You could try changing it to 6.0 (comes with XP SP3) as several things need it installed (iTunes IE7). The indent function apparently won't work below 4.0. On my system, it does not error, but it does not indent without being 4.0 or 6.0. I added an error check to see if the obj is created. It also tests for 4.0 and 6.0.

Yes it's intentional, the loop is from 1-3 to show that it returns an error when then number of params has been exceeded.

I thought about adding functions for attributes, but then the initial concept was to make it "Reg like".

I still might.

Edited by eltorro
Link to comment
Share on other sites

  • 2 weeks later...

Hello eltorro,

I really like your script. It saved me a lot of time writing a config reader/writer myself!

I do, however, have a question about it. When I use it (i.e. run a script from the SciTE Editor with F5) I get a lot of "3"s on the stdout, that is the place where runtime errors normally are printed. Do you have any idea why I get these? The script works as intended though, I'm just curious.

Best regards,

Schoel

Link to comment
Share on other sites

Hello eltorro, thank you for your script.

Have an one question:

how i can open my .xml config file that generated by me in the notepad:) and read parameters

#include <_ConfigIO.au3>
$Conf_File=_Config_Indent(@ScriptDir&"\config.xml")
$enab=_Config_Read($Conf_File, "win","w")

If not @error Then
MsgBox(0,"goga", $enab)
EndIf

in this case absence any messages, but my .xml file contains:

<?xml version="1.0" encoding="UTF-16" standalone="yes"?>
<CONFIG>
    <win>
        <w>1fgh</w>
    </win>
</CONFIG>

>Exit code: 0

What's wrong?

Link to comment
Share on other sites

Hello eltorro,

I really like your script. It saved me a lot of time writing a config reader/writer myself!

I do, however, have a question about it. When I use it (i.e. run a script from the SciTE Editor with F5) I get a lot of "3"s on the stdout, that is the place where runtime errors normally are printed. Do you have any idea why I get these? The script works as intended though, I'm just curious.

Best regards,

Schoel

Yes, the read function is sending the what the node type is to stdout. I have now removed it and a couple of others.

Links in the first post are still valid.

Link to comment
Share on other sites

chm isn't empty its a problem of XP SP2 and IE7 restrictions ... can be fixed, but would have to google to tell you how.

My corpo computer opened the chm (I could see the tree on the left), but won't open content (standard IE message on the right).

I fixed the problem by right-clicking on the .chm file, "properties" then click on the "unblock" button (maybe not unblock, my windows is in french... the button is near the read-only check box in the file properties).

It disable the run-protection for files from internet, then I can read the chm properly now.

Thanks Eltorro, great job.

Edited by sebned
Link to comment
Share on other sites

  • 2 weeks later...

Thanks El Toro.

I had the same problem with the chm (xp sp3), so I decompiled it and recompiled it on my machine. Attaching the file. Hope you don't mind me sharing it.

sorry guys: Upload failed. You are not permitted to upload this type of file!!

I used HTML Help Workshop to decompile and recompile.

Edited by ivan
Link to comment
Share on other sites

Thanks for the awesome script, but I have a question - I am trying to set up an XML file similar in structure to the one below:

<?xml version="1.0" encoding="ISO-8859-1"?> 
<catalog> 
<plant> 
  <common>Bloodroot</common> 
  <botanical>Sanguinaria canadensis</botanical> 
  <zone>4</zone> 
  <light>Mostly Shady</light> 
  <price>2.44</price> 
  <availability>03/15/2006</availability> 
  <indoor>true</indoor> 
</plant> 
<plant> 
  <common>Columbine</common> 
  <botanical>Aquilegia canadensis</botanical> 
  <zone>3</zone> 
  <light>Mostly Shady</light> 
  <price>9.37</price> 
  <availability>03/06/2006</availability> 
  <indoor>true</indoor> 
</plant> 
<plant> 
  <common>Marsh Marigold</common> 
  <botanical>Caltha palustris</botanical> 
  <zone>4</zone> 
  <light>Mostly Sunny</light> 
  <price>6.81</price> 
  <availability>05/17/2006</availability> 
  <indoor>false</indoor> 
</plant>

Using your AU3 as a base, part of my code for generating the file is:

_Config_Write($Fh,"Item","Name",$Namein)
_Config_Write($Fh,"Item","SKU",$Skuin)
_Config_Write($Fh,"Item","Price",$Pricein)

I'm not sure why yet, but the guy I am working with on a POS system wants the output to contain the "Item", same was as the "plant" above, but using your AU3 as an include I am unable to, the first item added works fine, the second is ignored due to the item tag being the same. Anything I can do here to make the <item> stay? I am assuming I could edit _ConfigIO somehow to just do it, but I'm not experienced enough to know how! :D

Thanks for any suggestions!

Ian

My projects:

  • IP Scanner - Multi-threaded ping tool to scan your available networks for used and available IP addresses, shows ping times, resolves IPs in to host names, and allows individual IPs to be pinged.
  • INFSniff - Great technicians tool - a tool which scans DriverPacks archives for INF files and parses out the HWIDs to a database file, and rapidly scans the local machine's HWIDs, searches the database for matches, and installs them.
  • PPK3 (Persistent Process Killer V3) - Another for the techs - suppress running processes that you need to keep away, helpful when fighting spyware/viruses.
  • Sync Tool - Folder sync tool with lots of real time information and several checking methods.
  • USMT Front End - Front End for Microsoft's User State Migration Tool, including all files needed for USMT 3.01 and 4.01, 32 bit and 64 bit versions.
  • Audit Tool - Computer audit tool to gather vital hardware, Windows, and Office information for IT managers and field techs. Capabilities include creating a customized site agent.
  • CSV Viewer - Displays CSV files with automatic column sizing and font selection. Lines can also be copied to the clipboard for data extraction.
  • MyDirStat - Lists number and size of files on a drive or specified path, allows for deletion within the app.
  • 2048 Game - My version of 2048, fun tile game.
  • Juice Lab - Ecigarette liquid making calculator.
  • Data Protector - Secure notes to save sensitive information.
  • VHD Footer - Add a footer to a forensic hard drive image to allow it to be mounted or used as a virtual machine hard drive.
  • Find in File - Searches files containing a specified phrase.
Link to comment
Share on other sites

  • 2 months later...

#include <_XMLDomWrapper.au3>
$sFile=@ScriptDir&"\dd.xml"
writexml()
readxml()

Func writexml()
    _XMLCreateFile($sFile, "config", True)
    _XMLFileOpen($sFile)
    _XMLCreateRootChild("option")
    _XMLCreateChildWAttr("config/option","update","auto","false")
    _XMLCreateChildWAttr("config/option","recordlastplaypos","auto","true")
    _XMLCreateChildNode("config/option","boxopen")
    _XMLCreateAttrib("config/option/boxopen","bystorm","false")
    _XMLCreateAttrib("config/option/boxopen","bylive","false")
EndFunc
Func readxml()
    _XMLFileOpen($sFile)
    MsgBox(0,"",_XMLGetAttrib("config/option/update","auto"))
    MsgBox(0,"",_XMLGetAttrib("config/option/recordlastplaypos","auto"))
    MsgBox(0,"",_XMLGetAttrib("config/option/boxopen","bylive"))
EndFunc

report a bug. _XMLGetAttrib() cann't get the right result.please fix it

Link to comment
Share on other sites

#include <_XMLDomWrapper.au3>
$sFile=@ScriptDir&"\dd.xml"
writexml()
readxml()

Func writexml()
    _XMLCreateFile($sFile, "config", True)
    _XMLFileOpen($sFile)
    _XMLCreateRootChild("option")
    _XMLCreateChildWAttr("config/option","update","auto","false")
    _XMLCreateChildWAttr("config/option","recordlastplaypos","auto","true")
    _XMLCreateChildNode("config/option","boxopen")
    _XMLCreateAttrib("config/option/boxopen","bystorm","false")
    _XMLCreateAttrib("config/option/boxopen","bylive","false")
EndFunc
Func readxml()
    _XMLFileOpen($sFile)
    MsgBox(0,"",_XMLGetAttrib("config/option/update","auto"))
    MsgBox(0,"",_XMLGetAttrib("config/option/recordlastplaypos","auto"))
    MsgBox(0,"",_XMLGetAttrib("config/option/boxopen","bylive"))
EndFunc

report a bug. _XMLGetAttrib() cann't get the right result.please fix it

Same as your post here, and was more suited in the topic you originally posted in...
Link to comment
Share on other sites

  • 4 years later...

Here is a very basic XML reader/writer. It is primarily intended for configuration files but is not limited to such.

It has functions similar to RegRead and RegWrite.

It does not support name spaces or attributes presently. (simple api ^_^ )

Syntax is pretty simple:

#include <_ConfigIO.au3>
Local $vRet

;create an config file with default settings and open it.
Local $Fh = _Config_Create(@ScriptDir&"\config.xml",1)

;write a setting
_Config_Write($Fh,"Application","ScriptPath",@ScriptFullPath)

;read a setting
$vRet =_Config_Read($Fh,"Application","ScriptPath")
If Not @error Then MsgBox(0,"ScriptPath",$vRet)

;Save it.
_Config_Save($Fh)

;close to release it.
_Config_Close($Fh)

Here is a list of functions:

  • _Config_Create
  • _Config_Open
  • _Config_Write
  • _Config_Read
  • _Config_EnumParam
  • _Config_EnumVal
  • _Config_Delete
  • _Config_Save
  • _Config_SaveAs
  • _Config_Close
  • _Config_Indent * Apparently need msxml4 or higher.
  • _Config_Base64_Encode * Needs AutoIt 3.3.X.
  • _Config_Base64_Decode * Needs AutoIt 3.3.X.
The UDF file:

_ConfigIO.au3

A chm file with examples:

_Config.chm

Edit:

Changed the example above to create the xml file

Added a check in the _Config_Indent function for object creation.

Edit:

Removed extra console output, checked for undeclared vars, updated docs.

hi eltoro ,

i was trying to download the _configIO.au3 file, can you please provide me the code for that. i was working on XML viewing and editing so this code will be a great help to me.

thanks in advance

Link to comment
Share on other sites

  • 1 year later...

 

The UDF file:

_ConfigIO.au3

A chm file with examples:

_Config.chm

 

this two links are broken.

Some body know how to get it ?

mLipok

Signature beginning:
* Please remember: "AutoIt"..... *  Wondering who uses AutoIt and what it can be used for ? * Forum Rules *
* ADO.au3 UDF * POP3.au3 UDF * XML.au3 UDF * IE on Windows 11 * How to ask ChatGPT for AutoIt Code * for other useful stuff click the following button:

Spoiler

Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind. 

My contribution (my own projects): * Debenu Quick PDF Library - UDF * Debenu PDF Viewer SDK - UDF * Acrobat Reader - ActiveX Viewer * UDF for PDFCreator v1.x.x * XZip - UDF * AppCompatFlags UDF * CrowdinAPI UDF * _WinMergeCompare2Files() * _JavaExceptionAdd() * _IsBeta() * Writing DPI Awareness App - workaround * _AutoIt_RequiredVersion() * Chilkatsoft.au3 UDF * TeamViewer.au3 UDF * JavaManagement UDF * VIES over SOAP * WinSCP UDF * GHAPI UDF - modest begining - comunication with GitHub REST API * ErrorLog.au3 UDF - A logging Library * Include Dependency Tree (Tool for analyzing script relations) * Show_Macro_Values.au3 *

 

My contribution to others projects or UDF based on  others projects: * _sql.au3 UDF  * POP3.au3 UDF *  RTF Printer - UDF * XML.au3 UDF * ADO.au3 UDF * SMTP Mailer UDF * Dual Monitor resolution detection * * 2GUI on Dual Monitor System * _SciLexer.au3 UDF * SciTE - Lexer for console pane * 

Useful links: * Forum Rules * Forum etiquette *  Forum Information and FAQs * How to post code on the forum * AutoIt Online Documentation * AutoIt Online Beta Documentation * SciTE4AutoIt3 getting started * Convert text blocks to AutoIt code * Games made in Autoit * Programming related sites * Polish AutoIt Tutorial * DllCall Code Generator * 

Wiki: * Expand your knowledge - AutoIt Wiki * Collection of User Defined Functions * How to use HelpFile * Good coding practices in AutoIt * 

OpenOffice/LibreOffice/XLS Related: WriterDemo.au3 * XLS/MDB from scratch with ADOX

IE Related:  * How to use IE.au3  UDF with  AutoIt v3.3.14.x * Why isn't Autoit able to click a Javascript Dialog? * Clicking javascript button with no ID * IE document >> save as MHT file * IETab Switcher (by LarsJ ) * HTML Entities * _IEquerySelectorAll() (by uncommon) * IE in TaskScheduler * IE Embedded Control Versioning (use IE9+ and HTML5 in a GUI) * PDF Related: * How to get reference to PDF object embeded in IE * IE on Windows 11 * 

I encourage you to read: * Global Vars * Best Coding Practices * Please explain code used in Help file for several File functions * OOP-like approach in AutoIt * UDF-Spec Questions *  EXAMPLE: How To Catch ConsoleWrite() output to a file or to CMD *

I also encourage you to check awesome @trancexx code:  * Create COM objects from modules without any demand on user to register anything. * Another COM object registering stuff * OnHungApp handler * Avoid "AutoIt Error" message box in unknown errors  * HTML editor * 

winhttp.au3 related : * https://www.autoitscript.com/forum/topic/206771-winhttpau3-download-problem-youre-speaking-plain-http-to-an-ssl-enabled-server-port/

"Homo sum; humani nil a me alienum puto" - Publius Terentius Afer
"Program are meant to be read by humans and only incidentally for computers and execute" - Donald Knuth, "The Art of Computer Programming"
:naughty:  :ranting:, be  :) and       \\//_.

Anticipating Errors :  "Any program that accepts data from a user must include code to validate that data before sending it to the data store. You cannot rely on the data store, ...., or even your programming language to notify you of problems. You must check every byte entered by your users, making sure that data is the correct type for its field and that required fields are not empty."

Signature last update: 2023-04-24

Link to comment
Share on other sites

mLipok,

The first website to check is Internet Archive: Wayback Machine

#include-once
; #INDEX# ========================================================================
; Title .........: _ConfigIO
; AutoIt Version : 3.3.0++
; Language ......: English
; Description ...: Functions that assist with reading and writiing configuration files. A very simple XML reader/writer.
; Author ........: Stephen Podhajecki (eltorro)
; ================================================================================
; #VARIABLES# ====================================================================
Global $__COM_ERR
Global Const $NODE_XML_INVALID = 0;
Global Const $NODE_XML_ELEMENT = 1;
Global Const $NODE_XML_ATTRIBUTE = 2;
Global Const $NODE_XML_TEXT = 3;
Global Const $NODE_XML_CDATA_SECTION = 4;
Global Const $NODE_XML_ENTITY_REFERENCE = 5;
Global Const $NODE_XML_ENTITY = 6;
Global Const $NODE_XML_PROCESSING_INSTRUCTION = 7;
Global Const $NODE_XML_COMMENT = 8;
Global Const $NODE_XML_DOCUMENT = 9;
Global Const $NODE_XML_DOCUMENT_TYPE = 10;
Global Const $NODE_XML_DOCUMENT_FRAGMENT = 11;
Global Const $NODE_XML_NOTATION = 12;
Global $XML_ENCODING[4] = [3, "iso-8859-1", "UTF-8", "UTF-16"] ; the first element sets the default encoding
Global $aCONFIG_FHDS[1][2] ;hold handles and filenames
; ================================================================================

; #NO_DOC_FUNCTION# ==============================================================
; Not working/documented/implimented at this time
; ================================================================================
; __Config_COMErr
; ================================================================================

; #CURRENT# ======================================================================
;_Config_Create
;_Config_Open
;_Config_Read
;_Config_Write
;_Config_Delete
;_Config_EnumParam
;_Config_EnumVal
;_Config_Save
;_Config_SaveAs
;_Config_Close
;_Config_Indent
;_Config_Base64_Encode
;_Config_Base64_Decode
; ================================================================================

; #INTERNAL_USE_ONLY#=============================================================
;__Config_CreateKeyRecursive
;__Config_KeyExists
;__Config_SetFileToHandle
;__Config_GetFileFromHandle
;__Config_RemoveFileHandle
;__Config_COMErr
;__Config_InitCOMErr
; ================================================================================

; #FUNCTION# =====================================================================
; Name...........: _Config_Create
; Description ...: Creates a configuration file
; Syntax.........: _Config_Create($szFileName, $iOverwrite = 0, $szRoot = "",$iEncoding = 0)
; Parameters ....: $szFileName - The filename for the configuration file
;                : $iOverwrite      - Overwrite exisiting file
;                  |0 - Don't overwrite, and return error
;                  |1 - Overwrite the file.
;                  |2 - Prompt to overwrite.
;                  $szRoot     - The value for the root node
;                  $iEncoding  - The encoding to use
;                  |0 - Default (UTF-16)
;                  |1 - iso-8859-1
;                  |2 - UTF-8
;                  |3 - UTF-16
; Return values .: Success - An XML object handle
;                  Failure - 0 and @error set to 1
; Author ........: Stephen Podhajecki (eltorro)
; Modified.......:
; Remarks .......: Creates the configuration file using the default encoding and root name. After creation,
;                  _Config_Open is called and the handle returned.  This file handle and the filename are cached
;                  and later used by _Config_Close and _Config_Save
; Related .......: _Config_Open, _Config_Close, _Config_Save, _Config_SaveAs
; Link ..........:
; Example .......: Yes
; ================================================================================
Func _Config_Create($szFileName, $iOverwrite = 0, $szRoot = "", $iEncoding = 0)
    If $szRoot = "" Then $szRoot = "CONFIG"
    If FileExists($szFileName) Then
        If $iOverwrite = 0 Then Return SetError(1, 0, 0)
        If $iOverwrite = 2 Then
            If MsgBox(266292, @ScriptName, "The file: " & $szFileName & " , already exists. Do you wish to overwrite the file?") <> 6 Then Return SetError(1, 0, 0)
        EndIf
    EndIf
    Local $hConfig, $objPI, $objRoot
    $hConfig = ObjCreate("MSXML2.DOMDocument")
    If $iEncoding <= 0 Or $iEncoding > UBound($XML_ENCODING) Then $iEncoding = $XML_ENCODING[0]
    $objPI = $hConfig.createProcessingInstruction("xml", StringFormat('version="1.0" encoding="%s"', $XML_ENCODING[$iEncoding]))
    $hConfig.appendChild($objPI)
    $objRoot = $hConfig.createElement($szRoot)
    $hConfig.documentElement = $objRoot
    $hConfig.save($szFileName)
    If $hConfig.parseError.errorCode <> 0 Then
        ConsoleWriteError("Error Creating specified file: " & $szFileName)
        SetError($hConfig.parseError.errorCode, 0, 0)
        Return 0
    EndIf
    $objPI = 0
    $objRoot = 0
    $hConfig = 0
    Return _Config_Open($szFileName)
EndFunc   ;==>_Config_Create

; #FUNCTION# ===================================================================
; Name...........: _Config_Open
; Description ...: Opens a configuration file
; Syntax.........: _Config_Open($szFileName)
; Parameters ....: $szFileName - The configuration file to open
; Return values .: Success - An XML object handle.
;                  Failure - 0 and @error set to 1
; Author ........: Stephen Podhajecki (eltorro)
; Modified.......:
; Remarks .......: Opens an XML configuration file and if succesful returns the object handle to the file.
; Related .......: _Config_Create, _Config_Close, _Config_Save, _Config_SaveAs
; Link ..........:
; Example .......: Yes
; ================================================================================
Func _Config_Open($szFileName)
    Local $hConfig
    $hConfig = ObjCreate("Msxml2.DOMDocument")
    If @error Then Return SetError(1, 0, 0)
    If IsObj($hConfig) Then
        __Config_InitCOMErr()
        $hConfig.async = False
        $hConfig.preserveWhiteSpace = True
        $hConfig.Load($szFileName)
        $hConfig.setProperty("SelectionLanguage", "XPath")
        If $hConfig.parseError.errorCode <> 0 Then
            ;ConsoleWriteError("Error opening specified file: " & $szFileName & @CRLF & $hConfig.parseError.reason)
            SetError($hConfig.parseError.errorCode, 0, 0)
            Return 0
        EndIf
        __Config_SetFileToHandle($hConfig, $szFileName)
        Return $hConfig
    EndIf
    Return SetError(1, 0, 0)
EndFunc   ;==>_Config_Open

; #FUNCTION# ===================================================================
; Name...........: _Config_Read
; Description ...: Read a value from the configuration file.
; Syntax.........: _Config_Read($hConfig, $szParam, $szValue)
; Parameters ....: $hConfig -  The object handle returned by _Config_Open or _Config_Create.
;                  $szParam - The name of the parameter to Read the value of.
;                  $szValue - The value name to read.
; Return values .: Success - The value.
;                  Failure - 0 and @error set to 1
; Author ........: Stephen Podhajecki (eltorro)
; Modified.......:
; Remarks .......:
; Related .......: _Config_Write, _Config_Delete
; Link ..........:
; Example .......: Yes
; ================================================================================
Func _Config_Read(ByRef $hConfig, $szParam, $szValue)
    If Not IsObj($hConfig) Then Return SetError(1, 0, 0)
    If $szParam = "" Then Return SetError(1, 0, 0)
    If $szValue Then $szParam &= "/" & $szValue
    Local $objKey, $szRet
    $szParam = StringReplace($szParam, "\", "/")
    $objKey = $hConfig.documentElement.selectSingleNode($szParam & "/child::text()")
    If IsObj($objKey) Then
        $szRet = $objKey.nodeValue
        $objKey = 0
        Return $szRet
    EndIf
    Return SetError(1, 0, 0)
EndFunc   ;==>_Config_Read

; #FUNCTION# ===================================================================
; Name...........: _Config_Write
; Description ...: Write a value in the configuration file.
; Syntax.........: _Config_Set($hConfig, $szParam, $vValue)
; Parameters ....: $hConfig -  The object handle returned by _Config_Open or _Config_Create.
;                  $szParam - The name of the parameter to write to
;                  $szValue - The value name to write to
;                  $vValue  - The value to write.
; Return values .: Success - 1
;                  Failure - 0 and @error set to 1
; Author ........: Stephen Podhajecki (eltorro)
; Modified.......:
; Remarks .......: Call _Config_Save or _Config_SaveAs to save any changes made.
; Related .......: _Config_Read, _Config_Delete
; Link ..........:
; Example .......: Yes
; ================================================================================
Func _Config_Write(ByRef $hConfig, $szParam, $szValue, $vValue)
    Local $err
    If Not IsObj($hConfig) Then Return SetError(1, 0, 0)
    If $szParam = "" Then Return SetError(1, 0, 0)
    If $szValue Then $szParam &= "/" & $szValue
    $szParam = StringReplace($szParam, "\", "/")
    If __Config_KeyExists($hConfig, $szParam) Then
        Local $objKey = $hConfig.documentElement.selectSingleNode($szParam & "/child::text()")
        If IsObj($objKey) Then
            $objKey.text = $vValue
        Else
            Local $objChild = $hConfig.createTextNode($vValue)
            $objKey = $hConfig.documentElement.selectSingleNode($szParam)
            $objKey.appendChild($objChild)
            $err = @error
            $objChild = 0
            $objKey = 0
            If $err Then Return SetError(1, 0, 0)
        EndIf
        $objKey = 0
    Else
        __Config_CreateKeyRecursive($hConfig, $szParam, $vValue)
        If @error Then Return SetError(1, 0, 0)
    EndIf
    Return 1
EndFunc   ;==>_Config_Write

; #FUNCTION# ===================================================================
; Name ..........: _Config_Delete
; Description ...: Delete a param from the config file.
; Syntax ........: _Config_Delete($hConfig, $szParam ,$szValue = "")
; Parameters ....: $hConfig - The config file handle
;                  $szParam - The name of the parameter to delete
;                  $szValue - The name of the value to delete
; Return values .: Success - 1
;                  Failure - 0 and @error set to 1
; Author ........: Stephen Podhajecki (eltorro)
; Modified.......:
; Remarks .......: Call _Config_Save or _Config_SaveAs to save any changes made.
;                  If $szValue is skipped then the parameter and sub-parameters are deleted.
; Related .......: _Config_Read, _Config_Write
; Link ..........:
; Example .......: Yes
; ================================================================================
Func _Config_Delete(ByRef $hConfig, $szParam, $szValue = "")
    If Not IsObj($hConfig) Then Return SetError(1, 0, 0)
    If $szParam = "" Then Return SetError(1, 0, 0)
    If $szValue Then $szParam &= "/" & $szValue
    $szParam = StringReplace($szParam, "\", "/")
    Local $objKey, $objChild
    $objKey = $hConfig.documentElement.selectSingleNode($szParam)
    If IsObj($objKey) Then
        ;only remove param if no sub-params like regedit
        If $objKey.hasChildNodes Then
            $objChild = $hConfig.documentElement.selectSingleNode($szParam & "/child::text()")
            If IsObj($objChild) Then
                $objChild.parentNode.removeChild($objChild)
            EndIf
            $objKey = $hConfig.documentElement.selectSingleNode($szParam)
            If Not $objKey.hasChildNodes Then $objKey.parentNode.removeChild($objKey)
        EndIf
        $objChild = 0
        $objKey = 0
        Return 1
    EndIf
    Return SetError(1, 0, 0)
EndFunc   ;==>_Config_Delete

; #FUNCTION# ===================================================================
; Name ..........: _Config_EnumParam
; Description ...: Reads the name of a parameter according to it's index.
; Syntax ........: _Config_EnumParam($hConfig,$szParam,$iIndex = 1)
; Parameters ....: $hConfig - The config file handle
;                  $szParam - The name of the parameter to enumerate
;                  $iIndex  - The 1-based index to retrieve
; Return values .: Success - The param
;                  Failure - 0 or empty String ("") and @error set to 1
; Author ........: Stephen Podhajecki (eltorro)
; Modified.......:
; Remarks .......: An empty string can be used for $szParam to enumerate the parameters under the root node.
; Related .......: _Config_EnumVal
; Link ..........:
; Example .......: Yes
; ================================================================================
Func _Config_EnumParam($hConfig, $szParam, $iIndex = 1)
    If $iIndex < 1 Or Not IsObj($hConfig) Then Return SetError(1, 0, 0)
    $szParam = StringReplace($szParam, "\", "/")
    Local $objKey, $vRet
    If $szParam = "" Then
        $szParam = "*[" & $iIndex & "]"
    Else
        $szParam &= "/*[" & $iIndex & "]"
    EndIf
    $objKey = $hConfig.documentElement.selectSingleNode($szParam)
    If IsObj($objKey) Then $vRet = $objKey.nodeName
    $objKey = 0
    Return SetError(($vRet = ""), 0, $vRet)
EndFunc   ;==>_Config_EnumParam

; #FUNCTION# ===================================================================
; Name ..........: _Config_EnumVal
; Description ...: Reads the value to a parameter according to it's index.
; Syntax ........: _Config_EnumVal($hConfig,$szParam,$iIndex)
; Parameters ....: $hConfig - The config file handle
;                  $szParam - The name of the parameter to enumerate
;                  $iIndex - The 1-based index to retrieve
; Return values .: Success - The value of the parameter
;                  Failure - 0 or empty string ("") and @error set to 1
; Author ........: Stephen Podhajecki (eltorro)
; Modified.......:
; Remarks .......: An empty string can be used for $szParam to enumerate the parameters under the root node.
; Related .......:
; Link ..........: _Config_EnumParam
; Example .......: Yes
; ================================================================================
Func _Config_EnumVal($hConfig, $szParam, $iIndex)
    If $iIndex < 1 Or Not IsObj($hConfig) Then Return SetError(1, 0, 0)
    $szParam = StringReplace($szParam, "\", "/")
    Local $objKey, $objChild, $vRet
    If $szParam = "" Then
        $szParam = "*[" & $iIndex & "]"
    Else
        $szParam &= "/*[" & $iIndex & "]"
    EndIf
    $objKey = $hConfig.documentElement.selectSingleNode($szParam)
    If IsObj($objKey) Then
        If $objKey.hasChildNodes Then
            $objChild = $hConfig.documentElement.selectSingleNode($szParam & "/child::text()")
            If IsObj($objChild) Then $vRet = $objChild.nodeValue
        EndIf
    EndIf
    $objChild = 0
    $objKey = 0
    Return SetError(($vRet = ""), 0, $vRet)
EndFunc   ;==>_Config_EnumVal

; #FUNCTION# ===================================================================
; Name...........: _Config_Save
; Description ...: Save the config file
; Syntax.........: _Config_Save($hConfig)
; Parameters ....: $hConfig - The config file handle
; Return values .: Success - 1
;                  Failure - 0
; Author ........: Stephen Podhajecki (eltorro)
; Modified.......:
; Remarks .......: This function explicitly saves the configuration file.  The filename is
;                  retrieved from the handle cache.  Use _Config_SaveAs the specify a filename.
; Related .......: _Config_SaveAs
; Link ..........:
; Example .......: Yes
; ================================================================================
Func _Config_Save(ByRef $hConfig)
    If IsObj($hConfig) Then
        Local $szFileName = __Config_GetFileFromHandle($hConfig)
        If $szFileName <> "" Then
            $hConfig.save($szFileName)
            If @error = 0 Then Return 1
        EndIf
    EndIf
    Return SetError(1, 0, 0)
EndFunc   ;==>_Config_Save

; #FUNCTION# ===================================================================
; Name...........: _Config_SaveAs
; Description ...: Save the config file as another filename
; Syntax.........: _Config_SaveAs($hConfig, $szFileName, $iOverwrite = 0)
; Parameters ....: $hConfig - The config file handle
;                  $szFileName -  The file name to save as.
;                  $iOverwrite -  The overwrite flag.
;                  |0 - Don't overwrite, and return error
;                  |1 - Overwrite the file.
;                  |2 - Prompt to overwrite.
; Return values .: Success - 1
;                  Failure - 0
; Author ........: Stephen Podhajecki (eltorro)
; Modified.......:
; Remarks .......: This function will save the configuration using the supplied file name. The new file name will
;                  now be associated with the file handle.
; Related .......: _Config_Save
; Link ..........:
; Example .......: Yes
; ================================================================================
Func _Config_SaveAs(ByRef $hConfig, $szFileName, $iOverwrite = 0)
    If IsObj($hConfig) And $szFileName <> "" Then
        If FileExists($szFileName) Then
            If $iOverwrite = 0 Then Return SetError(1, 0, 0)
            If $iOverwrite = 2 Then
                If MsgBox(266292, @ScriptName, "The file: " & $szFileName & " , already exists. Do you wish to overwrite the file?") <> 6 Then Return SetError(1, 0, 0)
            EndIf
        EndIf
        $hConfig.save($szFileName)
        If @error = 0 Then
            __Config_SetFileToHandle($hConfig, $szFileName)
            Return 1
        EndIf
    EndIf
    Return SetError(1, 0, 0)
EndFunc   ;==>_Config_SaveAs

; #FUNCTION# ===================================================================
; Name...........: _Config_Close
; Description ...: Close the config file
; Syntax.........: _Config_Close($hConfig,$iSaveOnClose = 1)
; Parameters ....: $hConfig - The config file handle
;                  $iSaveOnClose   - Save when closing the file. Defaults to 1 (yes)
; Return values .: Success - 1
;                  Failure - 0
; Author ........: Stephen Podhajecki (eltorro)
; Modified.......:
; Remarks .......: If $iSaveOnClose = 1 then the an attempt to save the config file will be made.
; Related .......: _Config_Create, _Config_Open, _Config_Save
; Link ..........:
; Example .......: Yes
; ================================================================================
Func _Config_Close(ByRef $hConfig, $iSaveOnClose = 1)
    Local $vRet
    If IsObj($hConfig) Then
        If $iSaveOnClose Then
            _Config_Save($hConfig)
            $vRet = @error
        EndIf
    EndIf
    __Config_RemoveFileHandle($hConfig)
    $hConfig = 0
    Return SetError($vRet, 0, ($vRet = 0))
EndFunc   ;==>_Config_Close

; #FUNCTION# ===================================================================
; Name ..........: _Config_Indent
; Description ...: Indents an XML file
; Syntax ........: _Config_Indent($szFileName, $iEncoding = 0)
; Parameters ....: $szFileName - The file to indent
;                  $iEncoding  - The encoding to use
;                  |0 - Default (UTF-16)
;                  |1 - iso-8859-1
;                  |2 - UTF-8
;                  |3 - UTF-16
; Return values .: None
; Author ........: Stephen Podhajecki (eltorro)
; Modified.......:
; Remarks .......: Uses msxml SAX methods to indent an xml file.  It is NOT PERFECT. HTML-Tidy does a much better job.
;                  Requires MSXML4.0 or greater.
; Related .......:
; Link ..........: http://tidy.sourceforge.net
; Example .......: Yes
; ================================================================================
Func _Config_Indent($szFileName, $iEncoding = 0)
    Local $oOutput = ObjCreate("MSXML2.DOMDocument.4.0")
    Local $oReader = ObjCreate("MSXML2.SAXXMLReader.4.0")
    Local $oWriter = ObjCreate("MSXML2.MXXMLWriter.4.0")
    If @error Then
        $oWriter = ObjCreate("MSXML2.MXXMLWriter.6.0")
        If @error Then Return SetError(1, 0, 0)
    EndIf
    If $iEncoding <= 0 Or $iEncoding > UBound($XML_ENCODING) Then $iEncoding = $XML_ENCODING[0]
    $oWriter.indent = True
    $oWriter.byteOrderMark = True
    $oWriter.encoding = $XML_ENCODING[$iEncoding]
    $oWriter.omitXMLDeclaration = False
    $oWriter.standalone = True
    $oReader.contentHandler = $oWriter
    $oReader.parseURL($szFileName)
    $oOutput.loadXML($oWriter.output)
    $oOutput.save($szFileName)
    $oReader = 0
    $oWriter = 0
    $oOutput = 0
EndFunc   ;==>_Config_Indent

; #FUNCTION# ===================================================================
; Name ..........: _Config_Base64_Encode
; Description ...: Encodes the data input to base64.
; Syntax ........: _Config_Base64_Encode($vData)
; Parameters ....: $vData - The base64 string to Encode
; Return values .: Success - The encoded base64 string.
;                  Failure -0 or empty string ("") and @error set to 1
; Author ........: Stephen Podhajecki (eltorro)
; Modified.......:
; Remarks .......: This fails to produce desired results unless using AutoIt ver 3.3.0.0
;                  or greater as byte array support for COM was not included previously.
; Related .......:
; Link ..........:
; Example .......: yes
; ================================================================================
Func _Config_Base64_Encode($vData)
    Local $err, $oXML
    If StringLeft(@AutoItVersion, 3) = "3.3" Then
        $oXML = ObjCreate("MSXML2.DOMDocument")
        $oXML.loadXML("<root/>")
        $oXML.documentElement.dataType = "bin.base64"
        If IsString($vData) Then $vData = StringToBinary($vData)
        $oXML.documentElement.NodeTypedValue = $vData
        Local $vRet = $oXML.documentElement.Text
        $err = @error
        $oXML = 0
        Return SetError(($err <> 0 Or $vRet = ""), $err, $vRet)
    EndIf
    Return SetError(1, 0, 0)
EndFunc   ;==>_Config_Base64_Encode

; #FUNCTION# ===================================================================
; Name ..........: _Config_Base64_Decode
; Description ...: Decodes a Base64 string to binary.
; Syntax ........: _Config_Base64_Decode($vData, $iFlag = 0)
; Parameters ....: $vData - The base64 string to decode
;                  $iFlag - Set return type 0 = binary, anything else = text(String).
; Return values .: Success - The decoded base64 string in binary or text.
;                  Failure - @error set to 1.  Return value may contain an error message.
; Author ........: Stephen Podhajecki (eltorro)
; Modified.......:
; Remarks .......: This fails to produce desired results unless using AutoIt ver 3.3.0.0
;                  or greater as byte array support for COM was not included previously.
; Related .......:
; Link ..........:
; Example .......: yes
; ================================================================================
Func _Config_Base64_Decode($vData, $iFlag = 0)
    Local $oXML, $vRet, $err = 0
    If StringLeft(@AutoItVersion, 3) = "3.3" Then
        $oXML = ObjCreate("MSXML2.DOMDocument")
        $oXML.loadXML("<root/>")
        $oXML.documentElement.dataType = "bin.base64"
        $oXML.documentElement.text = $vData
        $vRet = $oXML.documentElement.NodeTypedValue
        $err = @error
        $oXML = 0
        If $iFlag Then Return SetError(($err <> 0), $err, BinaryToString($vRet))
        Return SetError(($err <> 0), $err, $vRet)
    EndIf
    Return SetError(1, 0, "")
EndFunc   ;==>_Config_Base64_Decode


; #INTERNAL_USE_ONLY# ============================================================
; Name ..........: __Config_CreateKeyRecursive
; Description ...: Recursive method to create parameter key.
; Syntax ........: __Config_CreateKeyRecursive(ByRef $hConfig, $szParam, $vValue)
; Parameters ....: $hConfig - The config file handle
;                  $szParam - The name of the parameter to create.
;                  $vValue - The value of the parameter.
; Return values .: Succes - 1
;                  Failure - 0 and @error set to 1
; Author ........: Stephen Podhajecki {gehossafats at netmdc. com}
; Modified.......:
; Remarks .......:
; Related .......:
; Link ..........;
; Example .......; No
; ================================================================================
Func __Config_CreateKeyRecursive(ByRef $hConfig, $szParam, $vValue)
    If Not IsObj($hConfig) Then Return SetError(1, 0, 0)
    Local $aTemp = StringSplit($szParam, "\/")
    Local $objKey
    Local $sPath = "/" & $hConfig.documentElement.NodeName
    For $x = 1 To $aTemp[0]
        If Not __Config_KeyExists($hConfig, $sPath & "/" & $aTemp[$x]) Then
            Local $objChild = $hConfig.createNode($NODE_XML_ELEMENT, $aTemp[$x], "")
            If $x = $aTemp[0] Then $objChild.text = $vValue
            If $x = 1 Then
                $hConfig.documentElement.appendChild($objChild)
            Else
                $objKey = $hConfig.selectSingleNode($sPath)
                $objKey.appendChild($objChild)
            EndIf
        EndIf
        $sPath &= "/" & $aTemp[$x]
    Next
    Local $szFileName = __Config_GetFileFromHandle($hConfig)
    If $szFileName <> "" Then
        $hConfig.save($szFileName)
    EndIf
    Return 1
EndFunc   ;==>__Config_CreateKeyRecursive

; #INTERNAL_USE_ONLY#=============================================================
; Name ..........: __Config_KeyExists
; Description ...: Check if a node name exists
; Syntax ........: __Config_KeyExists(ByRef $hConfig, $szParam)
; Parameters ....: $hConfig - The config file handle
;                  $szParam - The name of the parameter to check for.
; Return values .: Success - 1
;                  Failure - 0
; Author ........: Stephen Podhajecki {gehossafats at netmdc. com}
; Modified.......:
; Remarks .......:
; Related .......:
; Link ..........;
; Example .......; no
; ================================================================================
Func __Config_KeyExists(ByRef $hConfig, $szParam)
    If StringStripWS($szParam, 3) = "" Then Return SetError(1, 0, "")
    If Not IsObj($hConfig) Then Return SetError(1, 0, 0)
    Local $node = $hConfig.documentelement.selectSingleNode($szParam)
    If IsObj($node) Then
        $node = 1
    Else
        $node = 0
    EndIf
    Return $node
EndFunc   ;==>__Config_KeyExists

; #INTERNAL_USE_ONLY#=============================================================
; Name ..........: __Config_GetFileFromHandle
; Description ...:
; Syntax ........: __Config_GetFileFromHandle(ByRef $hConfig)
; Parameters ....: $hConfig - The config file handle
; Return values .: Success - The filename and @extended contains the index in the cache
;                  Failure - 0 and @error set to 1
; Author ........: Stephen Podhajecki (eltorro)
; Modified.......:
; Remarks .......:
; Related .......:
; Link ..........:
; Example .......: no
; ================================================================================
Func __Config_GetFileFromHandle(ByRef $hConfig)
    For $x = 1 To $aCONFIG_FHDS[0][0]
        If $hConfig = $aCONFIG_FHDS[$x][0] Then Return SetError(0, $x, $aCONFIG_FHDS[$x][1])
    Next
    Return SetError(1, 0, 0)
EndFunc   ;==>__Config_GetFileFromHandle

; #INTERNAL_USE_ONLY#=============================================================
; Name ..........: __Config_SetFileToHandle
; Description ...: Add or changes the file handle to filename association in the handle cache.
; Syntax ........: __Config_SetFileToHandle(ByRef $hConfig , $szFileName)
; Parameters ....: $hConfig    - The config file handle
;                  $szFileName - The filename to associate with the handle
; Return values .: Success -  1
;                  Failure - 0 and @error set to 1
; Author ........: Stephen Podhajecki (eltorro)
; Modified.......:
; Remarks .......:
; Related .......:
; Link ..........:
; Example .......: no
; ================================================================================
Func __Config_SetFileToHandle(ByRef $hConfig, $szFileName)
    If IsObj($hConfig) And $szFileName <> "" Then
        If __Config_GetFileFromHandle($hConfig) <> "" Then
            $aCONFIG_FHDS[@extended][1] = $szFileName
        Else
            $aCONFIG_FHDS[0][0] += 1
            ReDim $aCONFIG_FHDS[$aCONFIG_FHDS[0][0] + 1][2]
            $aCONFIG_FHDS[$aCONFIG_FHDS[0][0]][0] = $hConfig
            $aCONFIG_FHDS[$aCONFIG_FHDS[0][0]][1] = $szFileName
        EndIf
        Return 1
    EndIf
    Return SetError(1, 0, 0)
EndFunc   ;==>__Config_SetFileToHandle

; #INTERNAL_USE_ONLY#=============================================================
; Name ..........: __Config_RemoveFileHandle
; Description ...: Removes a file handle and it's associated filename from the cache.
; Syntax ........: __Config_RemoveFileHandle(ByRef $hConfig)
; Parameters ....: $hConfig - The config file handle
; Return values .: Success -  The index of the removed item
;                  Failure -  0 and @error set to 1
; Author ........: Stephen Podhajecki (eltorro)
; Modified.......:
; Remarks .......:
; Related .......:
; Link ..........:
; Example .......: no
; ================================================================================
Func __Config_RemoveFileHandle(ByRef $hConfig)
    For $x = 1 To $aCONFIG_FHDS[0][0]
        If $hConfig = $aCONFIG_FHDS[$x][0] Then
            For $y = $x To $aCONFIG_FHDS[0][0] - 1
                $aCONFIG_FHDS[$y][0] = $aCONFIG_FHDS[$y + 1][0]
                $aCONFIG_FHDS[$y][1] = $aCONFIG_FHDS[$y + 1][1]
            Next
            $aCONFIG_FHDS[0][0] -= 1
            ReDim $aCONFIG_FHDS[$aCONFIG_FHDS[0][0] + 1][2]
            Return $x
        EndIf
    Next
    Return SetError(1, 0, 0)
EndFunc   ;==>__Config_RemoveFileHandle

; #INTERNAL_USE_ONLY#=============================================================
; Name ..........: __Config_COMErr
; Description ...: Sven com error handler
; Syntax ........: __Config_COMErr()
; Parameters ....: None.
; Return values .: @Error set to 1 and @Extended set to the COM error number.
; Author ........:
; Modified.......:
; Remarks .......: Default error handler.
; Related .......: __Config_InitCOMErr
; Link ..........:
; Example .......: no
; ================================================================================
Func __Config_COMErr()
    Local $HexNumber = Hex($__COM_ERR.number, 8)
    If @error Then Return SetError(1, 0, 0)
    Local $msg = "COM Error with DOM!" & @CRLF & @CRLF & _
            "err.description is: " & @TAB & $__COM_ERR.description & @CRLF & _
            "err.windescription:" & @TAB & $__COM_ERR.windescription & @CRLF & _
            "err.number is: " & @TAB & $HexNumber & @CRLF & _
            "err.lastdllerror is: " & @TAB & $__COM_ERR.lastdllerror & @CRLF & _
            "err.scriptline is: " & @TAB & $__COM_ERR.scriptline & @CRLF & _
            "err.source is: " & @TAB & $__COM_ERR.source & @CRLF & _
            "err.helpfile is: " & @TAB & $__COM_ERR.helpfile & @CRLF & _
            "err.helpcontext is: " & @TAB & $__COM_ERR.helpcontext
    ;MsgBox(0, @AutoItExe, $msg)
    SetError(1, $__COM_ERR.number, $msg)
EndFunc   ;==>__Config_COMErr

; #INTERNAL_USE_ONLY#=============================================================
; Name ..........: __Config_InitCOMErr
; Description ...: Initialize the COM error event handler.
; Syntax ........: __Config_InitCOMErr([$sFunction])
; Parameters ....: $sFunction - Function for COM error handler
; Return values .: None.
; Author ........:
; Modified.......:
; Remarks .......:
; Related .......:
; Link ..........:
; Example .......: [yes/no]
; ================================================================================
Func __Config_InitCOMErr($sFunction = "__Config_COMErr")
    If $__COM_ERR <> "" Then $__COM_ERR = ""
    $__COM_ERR = ObjEvent("AutoIt.Error", $sFunction) ; ; Initialize SvenP 's  error handler
EndFunc   ;==>__Config_InitCOMErr
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...