Delphi DLL – GetBytesPtr (Writing PByte to TStream)

Chilkat v9.5.0.80 adds a new BinData function named GetBytesPtr.   It returns a pointer to the internal bytes contained within the BinData.   This post shows one way of writing those bytes to a Delphi TStream (using the Chilkat non-ActiveX Delphi DLL). procedure TForm1.Button2Click(Sender: TObject); var rawBytes: PByte; ItemCount: Integer; binDat: HCkBinData; …

HTTP “broken pipe” Error on non-Windows Systems (Linux, iOS, MacOSX, etc.)

If you see the error lines “The connection already exists, as far as we know..” followed by “socketError: Broken pipe”  in any LastErrorText for a method that sends an HTTP request, it means the following:   The server replied to the previous request without a “Connection: close” header, thus allowing the …

Explaining OAuth2.StartAuth

This post explains the OAuth2 flow for desktop apps.   It begins by calling OAuth2.StartAuth. The oauth2.StartAuth method does two things: 1) Returns a URL that should be displayed in a browser. 2) Starts a background thread to receive the redirect callback from the browser. The flow of control is like …

iPad Simulator: Undefined symbols for architecture x86_64: _readdir$INODE64

Question: We are currently seeing the following error when we run the build on iPad Simulator Undefined symbols for architecture x86_64: “_readdir$INODE64”, referenced from: _ckFileList2::addDirNonRecursive2(int, FileMatchingSpec&, ExtPtrArrayXs&, ProgressMonitor*, LogBase&) in libchilkatIos.a(fileList.o) _ckFindFile::advancePositionLinux(char const*, LogBase&) in libchilkatIos.a(fileList.o) “_opendir$INODE64”, referenced from: _ckFindFile::ffOpenDir2(XString&, LogBase&) in libchilkatIos.a(fileList.o) _ckFileList2::addDirNonRecursive2(int, FileMatchingSpec&, ExtPtrArrayXs&, ProgressMonitor*, LogBase&) in libchilkatIos.a(fileList.o) …

Chilkat v9.5.0.80 Release Notes

The previous version release notes: Chilkat v9.5.0.79 Release Notes

Chilkat v9.5.0.80 Release Notes

    • 9-Aug-2019 Apple WatchOS: Added the static library for the arm64_32 architecture. 
    • 9-Aug-2019 iOS: Added an “iPad Apps for Mac” build.   This is a new set of Chilkat iOS libs built with Xcode 11.0 beta 5, on macOS Catalina (version 10.15 beta). This download contains the iOS libs for the usual architectures (armv7s, armv7, i386, and x86_64) but also contains a static lib build with UIKit for Mac. It is located in the lib/ipad_for_mac subdirectory. 
    • 10-Aug-2019  CertStore:  Added the OpenSmartcard method.   This is a Windows-only method that provides access to the certificates on the smart card currently inserted into the reader.   (Can also be used with a USB token.)
    • 18-Aug-2019 FileAccess:  The FileType method would never return the value 3 (for Symbolic Link) on non-Windows systems.  Instead it would follow the link and return the file type of the target.  This was fixed.
    • 20-Aug-2019 OAuth2: Added the NonceLength property.  If a nonce is included (as determined by the IncludeNonce property), the default NonceLength is 4 bytes (8 hex chars).  This property allows for an application to set the length of the nonce in bytes (for example 10 bytes = 20 hex chars).
    • 20-Aug-2019 Rsa: Added the PssSaltLen property.  The default value is -1, which is to use the hash algorithm length for the RSA PSS salt length. This property was added to satisify a customer system that required the PSS salt length to specifically be 20 bytes.
    • 22-Aug-2019: Xml: The DecodeEntities method assumed that all hex entities were 2 byte hex values.  It now handle 4 byte hex values such as ö and €
    • 22-Aug-2019: FileAccess: Added the FileSizeStr method to return the size of a file as a decimal string.
    • 22-Aug-2019: FileAccess: Added the ReadNextFragment method to provide a technique for processing huge files, especially intended for huge XML files.  (See the example linked from the reference documentation.)
    • 28-Aug-2019: TrustedRoots: Added the RejectSelfSignedCerts property to automatically reject TLS server certificates that are self-signed.
    • 28-Aug-2019: XmlDSigGen: Added “SigningTimeAdjust” to the list of Behaviors.
    •  29-Aug-2019: Email:  Fixed automatic Q/B decoding for email address header fields.  Normally, a TO or CC email header may be Q/B encoded such that the friendly-name part is encoded but not the address part.  For example:  “=?utf-8?B?TWF0dA==?= <>”.   This was already handled correctly.  However, if the entire name+address string, including the quotes around the name part are Q/B encoded, such as like this  “=?utf-8?B?Ik1hdHQiIDxzdXBwb3J0QGNoaWxrYXRzb2Z0LmNvbT4=?=”, then Chilkat returned the entire string as the email address, without decoding.  The GetTo, GetToName, GetToAddr, GetCC, GetCcName, and GetCcAddr methods will now return automatically decoded strings for this case.
    • 3-Sep-2019: JsonArray:  Strings within arrays were not properly escaped when emitting. 
      Note: This only applies to strings in an array, and only to strings explicitly added to the array by the methods JsonArray.AddStringAt or JsonArray.SetStringAt.
      For example, if in C++ we did this:
          CkJsonObject json;
          json.AddStringAt (-1, "string", "C:\\MyPath\\MyFile.txt");
          CkJsonArray* jarr = json.AppendArray ("array");
          jarr->AddStringAt (-1, "C:\\MyPath\\MyFile.txt");
          delete jarr;
      the output would be this:
        "string": "C:\\MyPath\\MyFile.txt",
        "array": [
          "C:\MyPath\MyFile.txt"   <--- The backslashes were not escaped.  This was fixed.
    • 8-Sep-2019: Xojo: Fixed the .so shared library for the ARM build (Raspberry Pi) to fix linking problems.
    • 10-Sep-2019: Http: Fixed problem with duplicated response content getting logged to the session log file (created via the http.SessionLogFilename property).
    • 21-Sep-2019: Rest: Improved auto-reconnect behavior for various methods and situations.
    • 23-Sep-2019: Gzip: Fixed: Setting the Comment property caused the .gz to be created incorrectly.  
    • 23-Sep-2019: BinData: Added the AppendPadded method.
    • 27-Sep-2019: Xml: The RemoveChild method did not remove the element if the last item in the tagPath is an array reference.  See
    • 3-Oct-2019: Http: (Fixed) The PText method returned non-null (i.e. returned an HttpResponse object) when a failure occurred such that no response was ever received, and therefore the responseObject’s status code would be 0.  The correct behavior is to return NULL.
    • 3-Oct-2019: FileAccess: Added the LockFileOnOpen property (applies only to applications running on the Windows operating system.)
    • 7-Oct-2019: FileAccess: Added the Truncate method (to truncate the currently open file at the current file position).
    • 8-Oct-2019: StringBuilder: Added the Obfuscate and Unobfuscate methods. 
    • 21-Oct-2019: Ftp2: Fixed the SetSslCertRequirement method.  It was not working as indicated in the reference documentation.
    • 22-Oct-2019: .NET Core: Fixed:  For Chilkat objects created as a return value from a method call, the event callbacks did not get called.

Android Java .so Shared Lib sizes, and Android C++ Linker Options to Minimize Size

The Chilkat v9.5.0.79 version reduces the size of the Android Java .so shared libs by approximately 24%. For example, the armv7l lib is reduced from 9.86MB to 7.56MB. For developers writing C++ code in Android (i.e. using the Android C++ libs downloaded from, you’ll want to include the following …

Electron: Uncaught Error: A dynamic link library (DLL) initialization routine failed.

Customer problem: Hi having trouble getting @chilkat/ck-electron4-win64 working. Im getting this error: Uncaught Error: A dynamic link library (DLL) initialization routine failed.\\?\C:\Users\User\Documents\xyz\node_modules\@chilkat\ck-electron4-win64\chilkat.node Resolution: I’m unable to reproduce the problem. Here are the steps taken to install Electron 4.0.4 and use Chilkat from scratch… using the Electron quick start as shown here:  …

XML Signature / Canonicalization Bug in Widely Used Software

Chilkat has found what it believes to be a bug in the internal XML canonicalization functionality in some other software systems. Chilkat’s XML canonicalization is correct, whereas some other established implementations are incorrect. Chilkat is adding a Behavior in v9.5.0.79 to allow for the bug to be reproduced so that …