Jump to content

Recommended Posts

Posted (edited)

This is modest beginning for UDF Chilkat component:
https://www.chilkatsoft.com/downloads_ActiveX.asp

Some of AcitveX object bundled into this component (dll file) are Free (you can verify it here), some other are commercial.

You can downolad this UDF here:

; #INDEX# ========================================================================
; Title .........: Chilkat.au3
; AutoIt Version : 3.3.10.2++
; Language ......: English
; Description ...: A collection of Function for use with Chilkat component
; Author ........: mLipok
; Modified ......:
; URL ...........: https://www.chilkatsoft.com/refdoc/activex.asp
; URL ...........: https://www.chilkatsoft.com/downloads_ActiveX.asp
; Date ..........: 2017/02/01
; Version .......: 0.1.1 BETA - Work in progress
; ================================================================================

#cs
    2017/02/01
    .   First official version - mLipok

#ce

http://www.chilkatforum.com/questions/1306/is-the-chilkat-upload-component-freeware

 

Examples:
 

#AutoIt3Wrapper_Au3Check_Parameters=-d -w 1 -w 2 -w 3 -w- 4 -w 5 -w 6 -w 7
;~ #AutoIt3Wrapper_Run_Debug_Mode=Y
#Tidy_Parameters=/sort_funcs /reel

#include <Array.au3>
#include <StringConstants.au3>
#include "Chilkat.au3"

_Example()
Func _Example()
    _ErrorLog_ChilkatWrapper(ConsoleWrite)
    _Chilkat_StartUp(@ScriptDir & '\ChilkatAx-9.5.0-win32.dll')
    _Chilkat_DllVersion($CHILKATOBJ_VERSION_950)

    Local $oGLOBAL = _Chilkat_GLOBAL_ObjCreate()
    If @error Then MsgBox($MB_ICONERROR, 'GLOBAL Declartion', '@error = ' & @error & @CRLF & '@extended = ' & @extended)

    _Chilkat_GLOBAL_UnlockBundle($oGLOBAL, "Anything for 30-day trial")
    If @error Then MsgBox($MB_ICONERROR, 'UnlockBundle', '@error = ' & @error & @CRLF & '@extended = ' & @extended)

    ; Just comment / uncomment one of this followin Examples functions:

;~  _Example_12_JsonObject_PrettyPrint()
;~  _Example_13_JsonObject_IterateMembers()
;~  _Example_14_JsonObject_CreateDocument()
;~  _Example_15_CSV_ColumnNames()
;~  _Example_16_CSV_ToArray()
    _Example_17_CSV_ToArray('(?i).*?Pierwszy.*?Urz.*?Skarb.*?', '(?i).*Katowice.*?')

EndFunc   ;==>_Example

Func _Example_12_JsonObject_PrettyPrint()
    _Log_ChilkatExample('_Example_12_JsonObject_PrettyPrint')
    ; https://www.example-code.com/vbscript/json_pretty_print.asp
    Local $oJSON = _Chilkat_JSON_ObjCreate()
    If @error Then Return SetError(@error, @extended, $CHILKAT_RET_FAILURE)

    Local $sJSON_String = "{""name"": ""donut"",""image"":{""fname"": ""donut.jpg"",""w"": 200,""h"": 200},""thumbnail"":{""fname"": ""donutThumb.jpg"",""w"": 32,""h"": 32}}"

    Local $iSuccess = $oJSON.Load($sJSON_String)
    If ($iSuccess <> 1) Then
        ConsoleWrite($oJSON.LastErrorText & @CRLF)
        Return SetError(@error, @extended, $CHILKAT_RET_FAILURE)
    EndIf

    ;  To pretty-print, set the EmitCompact property equal to 0
    $oJSON.EmitCompact = 0

    ;  If bare-LF line endings are desired, turn off EmitCrLf
    ;  Otherwise CRLF line endings are emitted.
    $oJSON.EmitCrLf = 0

    ;  Emit the formatted JSON:
    ConsoleWrite($oJSON.Emit() & @CRLF)
EndFunc   ;==>_Example_12_JsonObject_PrettyPrint

Func _Example_13_JsonObject_IterateMembers()
    _Log_ChilkatExample('_Example_13_JsonObject_IterateMembers')
    ; https://www.example-code.com/vbscript/json_iterate_members.asp
    Local $oJSON = _Chilkat_JSON_ObjCreate()
    If @error Then Return SetError(@error, @extended, $CHILKAT_RET_FAILURE)

    Local $sJSON_String = "{ ""id"": 1, ""name"": ""A green door"", ""tags"": [""home"", ""green""], ""price"": 125 }"

    Local $iSuccess = $oJSON.Load($sJSON_String)
    If ($iSuccess <> 1) Then
        ConsoleWrite($oJSON.LastErrorText & @CRLF)
        Return SetError($CHILKAT_ERR_LOAD, @extended, $CHILKAT_RET_FAILURE)
    EndIf

    Local $sName = '', $sValue = ''
    Local $iNumMembers = $oJSON.Size, $iValue = 0

    For $iMember_idx = 0 To $iNumMembers - 1
        $sName = $oJSON.NameAt($iMember_idx)
        $sValue = $oJSON.StringAt($iMember_idx)
        ConsoleWrite($sName & ": " & $sValue & @CRLF)

        $iValue = $oJSON.IntAt($iMember_idx)
        ConsoleWrite($sName & " as integer: " & $iValue & @CRLF)
    Next
EndFunc   ;==>_Example_13_JsonObject_IterateMembers

Func _Example_14_JsonObject_CreateDocument()
    _Log_ChilkatExample('_Example_14_JsonObject_CreateDocument')
    ; https://www.example-code.com/vbscript/create_json.asp
    Local $oJSON = _Chilkat_JSON_ObjCreate()
    If @error Then Return SetError(@error, @extended, $CHILKAT_RET_FAILURE)

    Local $iSuccess
    $iSuccess = $oJSON.AddStringAt(-1, "Title", "Pan's Labyrinth")
    ConsoleWrite("- $iSuccess=" & $iSuccess & @CRLF)
    $iSuccess = $oJSON.AddStringAt(-1, "Director", "Guillermo del Toro")
    ConsoleWrite("- $iSuccess=" & $iSuccess & @CRLF)
    $iSuccess = $oJSON.AddStringAt(-1, "Original_Title", "El laberinto del fauno")
    ConsoleWrite("- $iSuccess=" & $iSuccess & @CRLF)
    $iSuccess = $oJSON.AddIntAt(-1, "Year_Released", 2006)
    ConsoleWrite("- $iSuccess=" & $iSuccess & @CRLF)
    $oJSON.EmitCompact = 0
    ConsoleWrite($oJSON.Emit() & @CRLF)
EndFunc   ;==>_Example_14_JsonObject_CreateDocument

Func _Example_15_CSV_ColumnNames()
    _Log_ChilkatExample('_Example_15_CSV_ColumnNames')
    ; https://www.example-code.com/vbscript/csv_columnNames.asp

    Local $sURL = 'http://www.chilkatsoft.com/testData/sample.csv'
    InetGet($sURL, @ScriptDir & '\sample.csv')

    Local $oCSV = _Chilkat_CSV_ObjCreate()
    If @error Then Return SetError(@error, @extended, $CHILKAT_RET_FAILURE)

    ;  Prior to loading the CSV file, indicate that the 1st row
    ;  should be treated as column names:
    $oCSV.HasColumnNames = 1

    ; Load the $oCSV records from the file:
    Local $iSuccess = $oCSV.LoadFile(@ScriptDir & "\sample.csv")
    If ($iSuccess <> 1) Then
        ConsoleWrite($oCSV.LastErrorText & @CRLF)
        Return SetError($CHILKAT_ERR_LOADFILE, @extended, $CHILKAT_RET_FAILURE)
    EndIf

    Local $iIndex = 0
    Local $sColName = ''

    ; Display the column names:
    For $iCol_idx = 0 To $oCSV.NumColumns - 1
        $sColName = $oCSV.GetColumnName($iCol_idx)
        ConsoleWrite($iCol_idx & ": " & $sColName & @CRLF)

        ; The following line demonstrates to to get the column
        ; index given a column name:
        $iIndex = $oCSV.GetIndex($sColName)
        ConsoleWrite($sColName & " is at column index " & $iIndex & @CRLF)
    Next

EndFunc   ;==>_Example_15_CSV_ColumnNames

Func _Example_16_CSV_ToArray()
    _Log_ChilkatExample('_Example_16_CSV_ToArray')

    Local $sURL = 'http://www.chilkatsoft.com/testData/sample.csv'
    InetGet($sURL, @ScriptDir & '\sample.csv')

    Local $oCSV = _Chilkat_CSV_ObjCreate()
    If @error Then Return SetError(@error, @extended, $CHILKAT_RET_FAILURE)

    ;  Prior to loading the CSV file, indicate that the 1st row
    ;  should be treated as column names:
    $oCSV.HasColumnNames = 1

    ; Load the $oCSV records from the file:
    Local $iSuccess = $oCSV.LoadFile(@ScriptDir & "\sample.csv")
    If ($iSuccess <> 1) Then
        ConsoleWrite($oCSV.LastErrorText & @CRLF)
        Return SetError($CHILKAT_ERR_LOADFILE, @extended, $CHILKAT_RET_FAILURE)
    EndIf

    Local $iNumColumns = $oCSV.NumColumns
    Local $iNumRows = $oCSV.NumRows

    Local $aResult[$iNumRows + 1][$iNumColumns]

    ; First get the column names
    For $iCol_idx = 0 To $iNumColumns - 1
        $aResult[0][$iCol_idx] = $oCSV.GetColumnName($iCol_idx)
    Next

    For $iRow_idx = 0 To $iNumRows - 1
        For $iCol_idx = 0 To $iNumColumns - 1
            $aResult[$iRow_idx + 1][$iCol_idx] = $oCSV.GetCell($iRow_idx, $iCol_idx)
        Next
    Next

    _ArrayDisplay($aResult, '$aResult')

EndFunc   ;==>_Example_16_CSV_ToArray

Func _Example_17_CSV_ToArray($sName_RegExpPattern, $sCity_RegExpPattern)
    _Log_ChilkatExample('_Example_16_CSV_ToArray')
    ; https://www.example-code.com/vbscript/csv_columnNames.asp

    Local $sURL = 'https://epuap.gov.pl/wps/wcm/connect/61e062b9-d981-4526-9f63-c2569263775a/RESP_2016-10-07.csv?MOD=AJPERES'
    InetGet($sURL, @ScriptDir & '\ePUAP.csv')
    ConsoleWrite("- Download completed" & @CRLF)

    Local $oCSV = _Chilkat_CSV_ObjCreate()
    If @error Then Return SetError(@error, @extended, $CHILKAT_RET_FAILURE)

    ;  Prior to loading the CSV file, indicate that the 1st row
    ;  should be treated as column names:
    $oCSV.HasColumnNames = 1

    ; Load the $oCSV records from the file:
    Local $sCSVContent = FileRead(@ScriptDir & "\ePUAP.csv")
    ConsoleWrite("- Load File completed" & @CRLF)
    Local $iSuccess = $oCSV.LoadFromString($sCSVContent)
    If ($iSuccess <> 1) Then
        ConsoleWrite($oCSV.LastErrorText & @CRLF)
        Return SetError($CHILKAT_ERR_LOADFILE, @extended, $CHILKAT_RET_FAILURE)
    EndIf
    ConsoleWrite("- LoadFromString completed" & @CRLF)

    Local $iNumColumns = $oCSV.NumColumns
    Local $iNumRows = $oCSV.NumRows

    Local $aResult[$iNumRows + 1][$iNumColumns]

    ; First get the column names
    For $iCol_idx = 0 To $iNumColumns - 1
        $aResult[0][$iCol_idx] = $oCSV.GetColumnName($iCol_idx)
    Next

    Local $iResult_RowCount = 1 ; First is ColumnName
    For $iRow_idx = 0 To $iNumRows - 1
        If _
                StringRegExp($oCSV.GetCell($iRow_idx, 0), $sName_RegExpPattern, $STR_REGEXPMATCH) _
                And _
                StringRegExp($oCSV.GetCell($iRow_idx, 4), $sCity_RegExpPattern, $STR_REGEXPMATCH) _
                Then
            For $iCol_idx = 0 To $iNumColumns - 1
                $aResult[$iResult_RowCount][$iCol_idx] = $oCSV.GetCell($iRow_idx, $iCol_idx)
            Next
            $iResult_RowCount += 1
        EndIf
    Next

    ; strip array size to Number of founds rows
    ReDim $aResult[$iResult_RowCount][$iNumColumns]

    ConsoleWrite("- Parsing completed" & @CRLF)

    _ArrayDisplay($aResult, '$aResult')

EndFunc   ;==>_Example_17_CSV_ToArray

Func _Log_ChilkatExample($sData)
    ConsoleWrite('>+ ' & $sData & @CRLF)
EndFunc   ;==>_Log_ChilkatExample

 

REMARK:
This UDF is a continuation of this thread:

 

Edited by 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 Codefor 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 APIErrorLog.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 TaskSchedulerIE 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 stuffOnHungApp handlerAvoid "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

Posted

New version:

0.1.2
    2017/02/08
    .   Chnaged: few refactoring - mLipok
    .   Added: Function: _Chilkat_CSV_StringToArray() - mLipok
    .   Added: Function: _Chilkat_JSON_ObjFromString() - mLipok
    .   Added: Function: _Chilkat_JSON_ObjToString() - mLipok
    .   Added: $CHILKATOBJ_API - modes beginning for support to create object for future Chilkat Component version - 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 Codefor 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 APIErrorLog.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 TaskSchedulerIE 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 stuffOnHungApp handlerAvoid "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

Posted

As an example of how to use Chilkat.au3 UDF, you can check  TeamViewer.au3 UDF here:

 

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 Codefor 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 APIErrorLog.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 TaskSchedulerIE 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 stuffOnHungApp handlerAvoid "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

  • 2 weeks later...
Posted

Example showing how to create CSV file from the scratch:
 

Func _Example_CSV_CreateFile()
    _Log_ChilkatExample('_Example_CSV_CreateFile')

    ;  https://www.example-code.com/vbscript/csv_create.asp
    Local $oCSV = _Chilkat_CSV_ObjCreate()
    If @error Then MsgBox($MB_ICONERROR, 'CSV ObjectCreate', '@error = ' & @error & @CRLF & '@extended = ' & @extended)

    ;  Indicate that the 1st row
    ;  should be treated as column names:
    $oCSV.HasColumnNames = True ;

    Local $bSuccess = $oCSV.SetColumnName(0, "year")
    $bSuccess = $oCSV.SetColumnName(1, "color")
    $bSuccess = $oCSV.SetColumnName(2, "country")
    $bSuccess = $oCSV.SetColumnName(3, "food")

    $bSuccess = $oCSV.SetCell(0, 0, "2001")
    $bSuccess = $oCSV.SetCell(0, 1, "red")
    $bSuccess = $oCSV.SetCell(0, 2, "France")
    $bSuccess = $oCSV.SetCell(0, 3, "cheese")

    $bSuccess = $oCSV.SetCell(1, 0, "2005")
    $bSuccess = $oCSV.SetCell(1, 1, "blue")
    $bSuccess = $oCSV.SetCell(1, 2, "United States")
    $bSuccess = $oCSV.SetCell(1, 3, "hamburger")

    ;  Write the CSV to a string and display:
    Local $sCSV_String ;
    $sCSV_String = $oCSV.SaveToString() ;
    MsgBox(0, '', $sCSV_String)

    ;  Save the CSV to a file:
    $bSuccess = $oCSV.SaveFile("_Example_CSV_CreateFile_Result.csv") ;
    If Not $bSuccess Then ConsoleWrite($oCSV.LastErrorText)

EndFunc   ;==>_Example_CSV_CreateFile

 

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 Codefor 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 APIErrorLog.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 TaskSchedulerIE 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 stuffOnHungApp handlerAvoid "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

Posted

Here is variation about previous example:
 

Func _Example_CSV_CreateFile()
    _Log_ChilkatExample('_Example_CSV_CreateFile')

    ; https://www.example-code.com/vbscript/csv_create.asp

    ;  Indicate that the 1st row
    ;  should be treated as column names:
    __MY_CSV_API(Null)
    __MY_CSV_API("year", "color", "country", "food")
    __MY_CSV_API("2001", "red", "France", "cheese")
    __MY_CSV_API("2005", "blue", "United States", "hamburger")

    Local $oCSV = __MY_CSV_API()

    ;  Write the CSV to a string and display:
    Local $sCSV_String
    $sCSV_String = $oCSV.SaveToString()
    MsgBox(0, '', $sCSV_String)

    ;  Save the CSV to a file:
    Local $bSuccess = $oCSV.SaveFile("_Example_CSV_CreateFile_Result.csv")
    If Not $bSuccess Then ConsoleWrite($oCSV.LastErrorText)

EndFunc   ;==>_Example_CSV_CreateFile

Func __MY_CSV_API($vCol0 = Default, $vCol1 = Default, $vCol2 = Default, $vCol3 = Default)
    Local Static $oCSV = Null

    If $vCol0 = Null Or $oCSV = Null Then ; Create New Object
        $oCSV = _Chilkat_CSV_ObjCreate()
        $oCSV.HasColumnNames = True
    ElseIf $vCol0 = Default And $vCol1 = Default And $vCol2 = Default And $vCol3 = Default Then
        Return $oCSV
    ElseIf $oCSV.NumColumns = 0 Then
        $oCSV.SetColumnName(0, $vCol0)
        $oCSV.SetColumnName(1, $vCol1)
        $oCSV.SetColumnName(2, $vCol2)
        $oCSV.SetColumnName(3, $vCol3)
    Else
        Local $iRow = $oCSV.NumRows
        $oCSV.SetCell($iRow, 0, $vCol0)
        $oCSV.SetCell($iRow, 1, $vCol1)
        $oCSV.SetCell($iRow, 2, $vCol2)
        $oCSV.SetCell($iRow, 3, $vCol3)
    EndIf

EndFunc   ;==>__MY_CSV_API

 

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 Codefor 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 APIErrorLog.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 TaskSchedulerIE 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 stuffOnHungApp handlerAvoid "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

  • 8 months later...
Posted

New version:

0.1.3
    2017/11/12
    .   Added: Function: _Chilkat_ATOM_ObjCreate() - mLipok
    .   Added: Function: _Chilkat_CKSTRING_ObjCreate() - mLipok
    .   Added: Function: _Chilkat_EMAIL_ObjCreate() - mLipok
    .   Added: Function: _Chilkat_IMAP_ObjCreate() - mLipok
    .   Added: Function: _Chilkat_MAILMAN_ObjCreate() - mLipok
    .   Added: Function: _Chilkat_StringBuilder_ObjCreate() - mLipok
    .   Added: Function: _Chilkat_ZIP_ObjCreate() - mLipok
    .   Added: Function: _Chilkat_JSON_StringPretty() - mLipok
    .   Added: New Examples - mLipok

Download location:

 

 

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 Codefor 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 APIErrorLog.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 TaskSchedulerIE 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 stuffOnHungApp handlerAvoid "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

  • 1 year later...
Posted (edited)

I noticed that throughout your Chilkat.au3 UDF, you used ObjCreate() functions with class id, interface id, and dll handle as parameters like below:

Local $oObject = ObjCreate( _
        $CHILKATOBJ_API[$__g_iChilkat_DLLVersion][$CHILKATOBJ_NAME_JSON][$CHILKATOBJ_ID_CLSID], _
        $CHILKATOBJ_API[$__g_iChilkat_DLLVersion][$CHILKATOBJ_NAME_JSON][$CHILKATOBJ_ID_IID], _
        $__g_hDll_CHILKAT)

Is that an undocumented implementation of the ObjCreate() function?  I can't find any documentation that references that particular set of parameters for that function.  The only documentation, for the ObjCreate() function, that I have been able to find, lists its parameters as:

ObjCreate ( "classname" [, "servername" [, "username" [, "password"]]] )

I've also looked through AutoIt's version history and found no changes to the ObjCreate() function's parameters.  In any case, I can see where being able to use such an implementation of the function could be very useful if it works the way it appears to.  However, if it is undocumented, I guess it is that way for a reason and would be subject to change without any notice.  That was the first time in 12+ years of using AutoIt that I had ever seen the ObjCreate() function used with those set of parameters.  I found it interesting and thought I would ask.  :think:  :)

When I deploy Chilkat functionality in my scripts, I currently use a Side-by-Side method so I don't have to register the DLL, using regsvr32, on the target machine.  I simply have to deploy the DLL to the script's directory and either supply an external manifest that includes the necessary information or modify the internal manifest with the necessary info.  If the ObjCreate() function, the way you've implemented it, is another method that doesn't require having previously registered the DLL, then the way you've done it is an even easier and cleaner solution.

Edited by TheXman
Posted

Look also in my QuickPDF UDF.

This is experimental feature created by @trancexx.

I can try to find A topic where this was described. 

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 Codefor 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 APIErrorLog.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 TaskSchedulerIE 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 stuffOnHungApp handlerAvoid "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

Posted

Very interesting!  I will try to search for it also.  Thanks!

Posted

 

 

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 Codefor 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 APIErrorLog.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 TaskSchedulerIE 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 stuffOnHungApp handlerAvoid "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

  • 8 months later...
Posted

Hi. Thanks for this nice UDF.

Sorry because my bad English.

When looking through this library, I see you do not need to register chilkat.dll, but use DllOpen and ObjectCreate with interfaces.
But when I added the chilkat_httprequest function, it seemed that the response was not generated (it was not an object) without registering the dll.
So is it possible to get chilkat_httpresponse without registering the dll?

Thank you.

Posted

Please post examples. 

 

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 Codefor 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 APIErrorLog.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 TaskSchedulerIE 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 stuffOnHungApp handlerAvoid "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

Posted
10 hours ago, mLipok said:

Please post examples. 

 


In ChilkatContants.au3, I added:

$CHILKATOBJ_API[$CHILKATOBJ_VERSION_950][$CHILKATOBJ_NAME_HTTP][$CHILKATOBJ_ID_PROGID] = 'Chilkat_9_5_0.Http'
    $CHILKATOBJ_API[$CHILKATOBJ_VERSION_950][$CHILKATOBJ_NAME_HTTP][$CHILKATOBJ_ID_CLSID] = '{A74C26D2-2429-4099-8672-2250B15E327F}'
    $CHILKATOBJ_API[$CHILKATOBJ_VERSION_950][$CHILKATOBJ_NAME_HTTP][$CHILKATOBJ_ID_IID] = '{C754C4B4-6B0A-4664-ADDD-45467F0BCB7E}'

    $CHILKATOBJ_API[$CHILKATOBJ_VERSION_950][$CHILKATOBJ_NAME_HTTPREQUEST][$CHILKATOBJ_ID_PROGID] = 'Chilkat_9_5_0.HttpRequest'
    $CHILKATOBJ_API[$CHILKATOBJ_VERSION_950][$CHILKATOBJ_NAME_HTTPREQUEST][$CHILKATOBJ_ID_CLSID] = '{D66A2F08-A267-4593-ACD4-3EF65255E005}'
    $CHILKATOBJ_API[$CHILKATOBJ_VERSION_950][$CHILKATOBJ_NAME_HTTPREQUEST][$CHILKATOBJ_ID_IID] = '{495F8CD2-9F03-4A83-A9BC-FEEAE2182D9B}'

    $CHILKATOBJ_API[$CHILKATOBJ_VERSION_950][$CHILKATOBJ_NAME_HTTPRESPONSE][$CHILKATOBJ_ID_PROGID] = 'Chilkat_9_5_0.HttpResponse'
    $CHILKATOBJ_API[$CHILKATOBJ_VERSION_950][$CHILKATOBJ_NAME_HTTPRESPONSE][$CHILKATOBJ_ID_CLSID] = '{65EA825E-648E-4BF0-8AA3-4E7724F75B07}'
    $CHILKATOBJ_API[$CHILKATOBJ_VERSION_950][$CHILKATOBJ_NAME_HTTPRESPONSE][$CHILKATOBJ_ID_IID] = '{C143C715-0FED-4392-B207-1CA3CDF84C88}'

 

In Chilkat.au3, I added: Func _Chilkat_Http_ObjCreate, Func _Chilkat_HttpRequest_ObjCreate and Func _Chilkat_HttpResponse_ObjCreate. They are similar to other _Chilkat_xxx_ObjCreate functions.

 

My HttpRequest Code:

_ErrorLog_ChilkatWrapper(ConsoleWrite)
_Chilkat_StartUp(@ScriptDir & "\Chilkat" & (@AutoItX64 ? '-x64' : '') & ".dll")
_Chilkat_DllVersion($CHILKATOBJ_VERSION_950)

Local $oHttp = _Chilkat_Http_ObjCreate()
If Not IsObj($oHttp) Then Exit MsgBox(4096, 'Err', '_Chilkat_Http_ObjCreate')

Local $oHttpRequest = _Chilkat_HttpRequest_ObjCreate()
If Not IsObj($oHttpRequest) Then Exit MsgBox(4096, 'Err', '_Chilkat_HttpRequest_ObjCreate')

$resp = $oHttp.SynchronousRequest("www.autoitscript.com", 443, True, $oHttpRequest)

$resp is not HttpResponse Object without registering the chilkat/chilkat-x64.dll

Thanks for your help.

  • 1 year later...
Posted

@mLipok You are using Chilkat for many years.

I am getting Failed to read beginning of SSL/TLS record when using Chilkat Rest
may be due to I want to access a site which use TLS 1.2 on my window7 machine with no TLS updated patch install.

when use @trancexx WinHTTP I add this line for TLS 1.2 support

;~ WinHttp SetOption to use SECURE PROTOCOL TLS1.1 or TLS1.2
_WinHttpSetOption($__HttpOpen, _
$WINHTTP_OPTION_SECURE_PROTOCOLS, _
BitOR($WINHTTP_FLAG_SECURE_PROTOCOL_TLS1_1, $WINHTTP_FLAG_SECURE_PROTOCOL_TLS1_2))

So want to ask you what the alternative of the above line in Chilkat?
and is WebSocket possible on window7 using Chilkat?

Posted (edited)

I'm on vacation.

Ask me next week.

Then I be able to take a look.

Edited by 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 Codefor 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 APIErrorLog.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 TaskSchedulerIE 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 stuffOnHungApp handlerAvoid "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

  • 10 months later...
Posted (edited)

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 Codefor 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 APIErrorLog.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 TaskSchedulerIE 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 stuffOnHungApp handlerAvoid "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

Posted (edited)

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 Codefor 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 APIErrorLog.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 TaskSchedulerIE 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 stuffOnHungApp handlerAvoid "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

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
×
×
  • Create New...